900 |
How do I get ride of the separator items when the user performs grouping
// AddGroupItem event - Occurs after a new Group Item has been inserted to Items collection. void __fastcall TForm1::Grid1AddGroupItem(TObject *Sender,Exgridlib_tlb::HITEM Item) { Grid1->Items->set_ItemDividerLine(Item,Exgridlib_tlb::DividerLineEnum::EmptyLine); } Grid1->BeginUpdate(); Grid1->ColumnAutoResize = false; /* Select the Component\Import Component...\Import a Type Library, to import the following Type Library: Microsoft ActiveX Data Objects 6.1 Library TypeLib: msado15.dll to define the namespace: Adodb_tlb */ //#include "ADODB_TLB.h" Adodb_tlb::_RecordsetPtr rs = Variant::CreateObject(L"ADOR.Recordset"); rs->Open(TVariant("Orders"),TVariant("Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\\Program Files\\Exontrol\\ExGrid\\Sample\\Access\\misc.accdb"),Adodb_tlb::CursorTypeEnum::adOpenStatic,Adodb_tlb::LockTypeEnum::adLockOptimistic,0); Grid1->DataSource = (IDispatch*)rs; Grid1->SortBarVisible = true; Grid1->SortBarCaption = L"Drag a <b>column</b> header here to group by that column."; Grid1->AllowGroupBy = true; Grid1->Columns->get_Item(TVariant(1))->SortOrder = Exgridlib_tlb::SortOrderEnum::SortAscending; Grid1->LinesAtRoot = Exgridlib_tlb::LinesAtRootEnum::exGroupLinesOutside; Grid1->EndUpdate(); |
899 |
How do I split a cell in three parts, and having a radio button in each of them
// CellStateChanged event - Fired after cell's state has been changed. void __fastcall TForm1::Grid1CellStateChanged(TObject *Sender,Exgridlib_tlb::HITEM Item,long ColIndex) { OutputDebugString( Grid1->Items->get_CellCaption(TVariant(Item),TVariant(ColIndex)) ); } // Click event - Occurs when the user presses and then releases the left mouse button over the grid control. void __fastcall TForm1::Grid1Click(TObject *Sender) { long h = Grid1->ItemFromPoint[-1,-1,c,hit]; Grid1->Items->set_CellState(TVariant(h),TVariant(c),1); } Grid1->BeginUpdate(); Grid1->FullRowSelect = Exgridlib_tlb::CellSelectEnum::exColumnSel; Grid1->SelBackColor = Grid1->BackColor; Grid1->SelForeColor = Grid1->ForeColor; Grid1->DrawGridLines = Exgridlib_tlb::GridLinesEnum::exAllLines; Grid1->ShowFocusRect = false; Grid1->Columns->Add(L"Default")->set_Def(Exgridlib_tlb::DefColumnEnum::exCellValueFormat,TVariant(1)); Exgridlib_tlb::IItemsPtr var_Items = Grid1->Items; long h = var_Items->AddItem(TVariant("entire")); h = var_Items->AddItem(TVariant("Radio <b>1")); var_Items->set_CellRadioGroup(TVariant(h),TVariant(0),100); var_Items->set_CellHasRadioButton(TVariant(h),TVariant(0),true); var_Items->set_CellState(TVariant(h),TVariant(0),1); h = TVariant(var_Items->get_SplitCell(TVariant(h),TVariant(0))); var_Items->set_CellValue(TVariant(0),TVariant(h),TVariant("Radio <b>2")); var_Items->set_CellRadioGroup(TVariant(0),TVariant(h),100); var_Items->set_CellHasRadioButton(TVariant(0),TVariant(h),true); h = TVariant(var_Items->get_SplitCell(TVariant(0),TVariant(h))); var_Items->set_CellValue(TVariant(0),TVariant(h),TVariant("Radio <b>3")); var_Items->set_CellRadioGroup(TVariant(0),TVariant(h),100); var_Items->set_CellHasRadioButton(TVariant(0),TVariant(h),true); h = var_Items->AddItem(TVariant("entire")); Grid1->EndUpdate(); |
898 |
Does your grid include a row indicator , like an arrow, bullet
// SelectionChanged event - Fired after a new item has been selected. void __fastcall TForm1::Grid1SelectionChanged(TObject *Sender) { Exgridlib_tlb::IItemsPtr var_Items = Grid1->Items; long hFocusItem = var_Items->FocusItem; var_Items->set_CellValue(TVariant(Grid1->Columns->get_Item(TVariant("active"))->get_Data()),TVariant("active"),TVariant("")); var_Items->set_CellValue(TVariant(hFocusItem),TVariant("active"),TVariant("<c><font symbol>·")); var_Items->set_CellVAlignment(TVariant(hFocusItem),TVariant("active"),Exgridlib_tlb::VAlignmentEnum::exBottom); Grid1->Columns->get_Item(TVariant("active"))->set_Data(TVariant(hFocusItem)); } Grid1->BeginUpdate(); Grid1->ColumnAutoResize = false; /* Select the Component\Import Component...\Import a Type Library, to import the following Type Library: Microsoft ActiveX Data Objects 6.1 Library TypeLib: msado15.dll to define the namespace: Adodb_tlb */ //#include "ADODB_TLB.h" Adodb_tlb::_RecordsetPtr rs = Variant::CreateObject(L"ADOR.Recordset"); rs->Open(TVariant("Orders"),TVariant("Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\\Program Files\\Exontrol\\ExGrid\\Sample\\Access\\misc.accdb"),Adodb_tlb::CursorTypeEnum::adOpenStatic,Adodb_tlb::LockTypeEnum::adLockOptimistic,0); Grid1->DataSource = (IDispatch*)rs; Grid1->ShowFocusRect = false; Grid1->ContinueColumnScroll = true; Grid1->ScrollBySingleLine = true; Grid1->AutoDrag = Exgridlib_tlb::AutoDragEnum::exAutoDragScrollOnShortTouch | Exgridlib_tlb::AutoDragEnum::exAutoDragScroll; Exgridlib_tlb::IColumnPtr var_Column = Grid1->Columns->Add(L""); var_Column->Key = L"active"; var_Column->Position = 0; var_Column->AllowSizing = false; var_Column->Width = 12; var_Column->set_Data(TVariant(Grid1->Items->FocusItem)); var_Column->set_Def(Exgridlib_tlb::DefColumnEnum::exCellValueFormat,TVariant(1)); Grid1->CountLockedColumns = 1; Exgridlib_tlb::IItemsPtr var_Items = Grid1->Items; var_Items->set_SelectItem(var_Items->get_NextVisibleItem(var_Items->FocusItem),true); Grid1->EndUpdate(); |
897 |
How can I connect to a DBF file
Grid1->ColumnAutoResize = false; Grid1->ContinueColumnScroll = false; /* Select the Component\Import Component...\Import a Type Library, to import the following Type Library: Microsoft ActiveX Data Objects 6.1 Library TypeLib: msado15.dll to define the namespace: Adodb_tlb */ //#include "ADODB_TLB.h" Adodb_tlb::_RecordsetPtr rs = Variant::CreateObject(L"ADODB.Recordset"); rs->Open(TVariant("Select * From foxcode.DBF"),TVariant("Provider=vfpoledb;Data Source=C:\\Program Files\\Microsoft Visual FoxPro 9\\"),Adodb_tlb::CursorTypeEnum::adOpenStatic,Adodb_tlb::LockTypeEnum::adLockOptimistic,0); Grid1->DataSource = (IDispatch*)rs; |
896 |
Does your control supports scrolling by touching the screen
Grid1->ColumnAutoResize = false; /* Select the Component\Import Component...\Import a Type Library, to import the following Type Library: Microsoft ActiveX Data Objects 6.1 Library TypeLib: msado15.dll to define the namespace: Adodb_tlb */ //#include "ADODB_TLB.h" Adodb_tlb::_RecordsetPtr rs = Variant::CreateObject(L"ADOR.Recordset"); rs->Open(TVariant("Orders"),TVariant("Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\\Program Files\\Exontrol\\ExGrid\\Sample\\Access\\misc.accdb"),Adodb_tlb::CursorTypeEnum::adOpenStatic,Adodb_tlb::LockTypeEnum::adLockOptimistic,0); Grid1->DataSource = (IDispatch*)rs; Grid1->ContinueColumnScroll = true; Grid1->ScrollBySingleLine = true; Grid1->AutoDrag = Exgridlib_tlb::AutoDragEnum::exAutoDragScrollOnShortTouch | Exgridlib_tlb::AutoDragEnum::exAutoDragScroll; |
895 |
How do I prevent showing the control's BackColorAlternate property on empty / non-items part of the control
Grid1->BeginUpdate(); Grid1->BackColorAlternate = 0x7ff0f0f0; Grid1->Columns->Add(L"Column"); Exgridlib_tlb::IItemsPtr var_Items = Grid1->Items; var_Items->AddItem(TVariant("Item 1")); var_Items->AddItem(TVariant("Item 2")); var_Items->AddItem(TVariant("Item 3")); var_Items->AddItem(TVariant("Item 4")); var_Items->AddItem(TVariant("Item 5")); Grid1->EndUpdate(); |
894 |
Is there any method for reading information from the root item for the current item...
Grid1->BeginUpdate(); Grid1->LinesAtRoot = Exgridlib_tlb::LinesAtRootEnum::exLinesAtRoot; Grid1->SearchColumnIndex = 0; Grid1->Columns->Add(L"Info"); Exgridlib_tlb::IItemsPtr var_Items = Grid1->Items; var_Items->PathSeparator = L" ; "; var_Items->set_SelectItem(var_Items->InsertItem(var_Items->InsertItem(var_Items->InsertItem(var_Items->InsertItem(TNoParam(),TNoParam(),TVariant("Root")),TNoParam(),TVariant("Child")),TNoParam(),TVariant("Sub-Child")),TNoParam(),TVariant("Sub-Sub-Child")),true); var_Items->set_ExpandItem(0,true); OutputDebugString( var_Items->get_FullPath(var_Items->FocusItem) ); Grid1->EndUpdate(); |
893 |
How can I highlight items with a specified date
Grid1->BeginUpdate(); Exgridlib_tlb::IColumnsPtr var_Columns = Grid1->Columns; var_Columns->Add(L"Tasks"); Exgridlib_tlb::IColumnPtr var_Column = var_Columns->Add(L"Date"); var_Column->SortType = Exgridlib_tlb::SortTypeEnum::SortDate; var_Column->Editor->EditType = Exgridlib_tlb::EditTypeEnum::SpinType; Exgridlib_tlb::IItemsPtr var_Items = Grid1->Items; var_Items->set_CellValue(TVariant(var_Items->AddItem(TVariant("Task 1"))),TVariant(1),TVariant(TDateTime(2001,12,13).operator double())); var_Items->set_CellValue(TVariant(var_Items->AddItem(TVariant("Task 2"))),TVariant(1),TVariant(TDateTime(2001,12,14).operator double())); var_Items->set_CellValue(TVariant(var_Items->AddItem(TVariant("Task 2"))),TVariant(1),TVariant(TDateTime(2001,12,15).operator double())); Grid1->ConditionalFormats->Add(L"%1 = #12/14/2001#",TNoParam())->Bold = true; Grid1->EndUpdate(); |
892 |
Today date is shown, if we use the Column.FormatColumn and Editor.Option(exDateAllowNullDate) properties. What can be done
Grid1->BeginUpdate(); Exgridlib_tlb::IColumnPtr var_Column = Grid1->Columns->Add(L"Date"); var_Column->FormatColumn = TVariant(String("len(value) ? ( (longdate(date(value)) left 3) + ' ' + day(date(value)) + '/' + month(date(value)) + '/' + (year(date(value)) ri") + "ght 2) ) : '' )"); Exgridlib_tlb::IEditorPtr var_Editor = var_Column->Editor; var_Editor->EditType = Exgridlib_tlb::EditTypeEnum::DateType; var_Editor->set_Option(Exgridlib_tlb::EditorOptionEnum::exDateAllowNullDate,TVariant(true)); Exgridlib_tlb::IItemsPtr var_Items = Grid1->Items; var_Items->AddItem(TVariant(TDateTime(2012,5,12).operator double())); var_Items->AddItem(TNoParam()); var_Items->AddItem(TVariant(TDateTime(2012,5,14).operator double())); Grid1->EndUpdate(); |
891 |
How can I add multiple values/columns on the same line/item/row
// Change event - Occurs when the user changes the cell's content. void __fastcall TForm1::Grid1Change(TObject *Sender,Exgridlib_tlb::HITEM Item,long ColIndex,Variant * NewValue) { Grid1->Refresh(); } Grid1->BeginUpdate(); Grid1->SortOnClick = Exgridlib_tlb::SortOnClickEnum::exNoSort; Grid1->LinesAtRoot = Exgridlib_tlb::LinesAtRootEnum::exGroupLinesOutside; Grid1->Indent = 13; Grid1->HeaderVisible = false; Grid1->LinesAtRoot = Exgridlib_tlb::LinesAtRootEnum::exLinesAtRoot; Exgridlib_tlb::IColumnsPtr var_Columns = Grid1->Columns; var_Columns->Add(L"Items"); var_Columns->Add(L"Quantity")->Editor->EditType = Exgridlib_tlb::EditTypeEnum::SpinType; var_Columns->Add(L"Value")->Editor->EditType = Exgridlib_tlb::EditTypeEnum::SpinType; Exgridlib_tlb::IItemsPtr var_Items = Grid1->Items; long h = var_Items->AddItem(TVariant("Items")); var_Items->set_CellValue(TVariant(h),TVariant(2),TVariant("sum(current,dir,dbl(%1)*dbl(%2))")); var_Items->set_CellValueFormat(TVariant(h),TVariant(2),Exgridlib_tlb::ValueFormatEnum::exTotalField); var_Items->set_FormatCell(TVariant(h),TVariant(2),L"`Total: `+ value"); var_Items->set_CellHAlignment(TVariant(h),TVariant(2),Exgridlib_tlb::AlignmentEnum::RightAlignment); var_Items->set_CellBold(TVariant(h),TVariant(2),true); var_Items->set_CellEditorVisible(TVariant(h),TVariant(2),Exgridlib_tlb::EditorVisibleEnum::exEditorHidden); var_Items->set_CellEditorVisible(TVariant(h),TVariant(1),Exgridlib_tlb::EditorVisibleEnum::exEditorHidden); long h1 = var_Items->InsertItem(h,TNoParam(),TVariant("Item 1")); var_Items->set_CellValue(TVariant(h1),TVariant(1),TVariant(10)); var_Items->set_CellValue(TVariant(h1),TVariant(2),TVariant(3)); h1 = var_Items->InsertItem(h,TNoParam(),TVariant("Item 2")); var_Items->set_CellValue(TVariant(h1),TVariant(1),TVariant(20)); var_Items->set_CellValue(TVariant(h1),TVariant(2),TVariant(4)); var_Items->set_ExpandItem(h,true); Grid1->EndUpdate(); |
890 |
Is there a syntax for conditional formatting of items, based on CellState/CellStateChange
// CellStateChanged event - Fired after cell's state has been changed. void __fastcall TForm1::Grid1CellStateChanged(TObject *Sender,Exgridlib_tlb::HITEM Item,long ColIndex) { Exgridlib_tlb::IItemsPtr var_Items = Grid1->Items; var_Items->set_CellValue(TVariant(Item),TVariant(2),TVariant(var_Items->get_CellState(TVariant(Item),TVariant(0)))); } Grid1->BeginUpdate(); Grid1->ShowFocusRect = false; Grid1->SelBackMode = Exgridlib_tlb::BackModeEnum::exTransparent; Exgridlib_tlb::IConditionalFormatPtr var_ConditionalFormat = Grid1->ConditionalFormats->Add(L"%2 != 0",TNoParam()); var_ConditionalFormat->Bold = true; var_ConditionalFormat->ForeColor = RGB(255,0,0); var_ConditionalFormat->ApplyTo = Exgridlib_tlb::FormatApplyToEnum::exFormatToItems; Exgridlib_tlb::IColumnPtr var_Column = Grid1->Columns->Add(L""); var_Column->set_Def(Exgridlib_tlb::DefColumnEnum::exCellHasCheckBox,TVariant(true)); var_Column->Width = 16; var_Column->AllowSizing = false; Grid1->Columns->Add(L"Information"); Grid1->Columns->Add(L"Hidden")->Visible = false; Exgridlib_tlb::IItemsPtr var_Items = Grid1->Items; var_Items->set_CellValue(TVariant(var_Items->AddItem(TVariant(""))),TVariant(1),TVariant("This is a bit of text associated")); long h = var_Items->AddItem(TVariant("")); var_Items->set_CellValue(TVariant(h),TVariant(1),TVariant("This is a bit of text associated")); var_Items->set_CellState(TVariant(h),TVariant(0),1); var_Items->set_CellValue(TVariant(var_Items->AddItem(TVariant(""))),TVariant(1),TVariant("This is a bit of text associated")); Grid1->EndUpdate(); |
889 |
How do I programatically focus a cell
// FocusChanged event - Occurs when a new cell is focused. void __fastcall TForm1::Grid1FocusChanged(TObject *Sender) { Exgridlib_tlb::IItemsPtr var_Items = Grid1->Items; var_Items->set_CellBackColor(TVariant(var_Items->FocusItem),TVariant(Grid1->FocusColumnIndex),RGB(255,0,0)); } Grid1->BeginUpdate(); Grid1->SelForeColor = Grid1->ForeColor; Grid1->SelBackColor = Grid1->BackColor; Grid1->DrawGridLines = Exgridlib_tlb::GridLinesEnum::exRowLines; Exgridlib_tlb::IColumnsPtr var_Columns = Grid1->Columns; var_Columns->Add(L"Column1"); var_Columns->Add(L"Column2"); Exgridlib_tlb::IItemsPtr var_Items = Grid1->Items; var_Items->set_CellValue(TVariant(var_Items->AddItem(TVariant("Cell 1.1"))),TVariant(1),TVariant("Cell 1.2")); var_Items->set_CellValue(TVariant(var_Items->AddItem(TVariant("Cell 2.1"))),TVariant(1),TVariant("Cell 2.2")); Exgridlib_tlb::IItemsPtr var_Items1 = Grid1->Items; var_Items1->set_SelectItem(var_Items1->get_ItemByIndex(1),true); Grid1->FocusColumnIndex = 1; Grid1->EndUpdate(); |
888 |
How do I programatically focus a cell (excrd)
// FocusChanged event - Occurs when a new cell is focused. void __fastcall TForm1::Grid1FocusChanged(TObject *Sender) { Exgridlib_tlb::IItemsPtr var_Items = Grid1->Items; var_Items->set_CellBackColor(TVariant(var_Items->FocusItem),TVariant(Grid1->FocusColumnIndex),RGB(255,0,0)); } Grid1->BeginUpdate(); Grid1->SelForeColor = Grid1->ForeColor; Grid1->SelBackColor = Grid1->BackColor; Grid1->DrawGridLines = Exgridlib_tlb::GridLinesEnum::exRowLines; Grid1->DefaultItemHeight = 36; Exgridlib_tlb::IColumnsPtr var_Columns = Grid1->Columns; var_Columns->Add(L"Column1")->Visible = false; var_Columns->Add(L"Column2")->Visible = false; var_Columns->Add(L"Column3")->Visible = false; Exgridlib_tlb::IColumnPtr var_Column = var_Columns->Add(L"FormatLevel"); var_Column->FormatLevel = L"(0/1),2"; var_Column->set_Def(Exgridlib_tlb::DefColumnEnum::exCellFormatLevel,TVariant(var_Column->FormatLevel)); Exgridlib_tlb::IItemsPtr var_Items = Grid1->Items; long h = var_Items->AddItem(TVariant("Cell 1.1")); var_Items->set_CellValue(TVariant(h),TVariant(1),TVariant("Cell 1.2")); var_Items->set_CellValue(TVariant(h),TVariant(2),TVariant("Cell 1.3")); h = var_Items->AddItem(TVariant("Cell 2.1")); var_Items->set_CellValue(TVariant(h),TVariant(1),TVariant("Cell 2.2")); var_Items->set_CellValue(TVariant(h),TVariant(2),TVariant("Cell 2.3")); Exgridlib_tlb::IItemsPtr var_Items1 = Grid1->Items; var_Items1->set_SelectItem(var_Items1->get_ItemByIndex(1),true); Grid1->FocusColumnIndex = 2; Grid1->EndUpdate(); |
887 |
How do I programmatically exclude items from the filter
Grid1->BeginUpdate(); Grid1->LinesAtRoot = Exgridlib_tlb::LinesAtRootEnum::exLinesAtRoot; Exgridlib_tlb::IColumnPtr var_Column = Grid1->Columns->Add(L"Items"); var_Column->DisplayFilterButton = true; var_Column->DisplayFilterPattern = false; var_Column->FilterList = Exgridlib_tlb::FilterListEnum::exShowExclude | Exgridlib_tlb::FilterListEnum::exShowFocusItem | Exgridlib_tlb::FilterListEnum::exShowCheckBox; Exgridlib_tlb::IItemsPtr var_Items = Grid1->Items; var_Items->AddItem(TVariant("Item 1")); var_Items->AddItem(TVariant("Item 2")); var_Items->AddItem(TVariant("Item 3")); var_Items->AddItem(TVariant("Item 4")); Exgridlib_tlb::IColumnPtr var_Column1 = Grid1->Columns->get_Item(TVariant(0)); var_Column1->FilterType = Exgridlib_tlb::FilterTypeEnum::exFilterExclude | Exgridlib_tlb::FilterTypeEnum::exFilter; var_Column1->Filter = L"Item 1|Item 4"; Grid1->ApplyFilter(); Grid1->EndUpdate(); |
886 |
Using the property Column.FormatColumn I want to display numbers in the numeric format with no decimals - unless the value is NULL then I want to display a blank or empty
Grid1->BeginUpdate(); Exgridlib_tlb::IColumnsPtr var_Columns = Grid1->Columns; var_Columns->Add(L"Format")->FormatColumn = L"len(value) ? (value format '0') : '' "; Exgridlib_tlb::IItemsPtr var_Items = Grid1->Items; var_Items->AddItem(TVariant(10)); var_Items->AddItem(TNoParam()); var_Items->AddItem(TVariant(-8)); Grid1->EndUpdate(); |
885 |
How can I change the drop down filter background color
Grid1->BeginUpdate(); Grid1->LinesAtRoot = Exgridlib_tlb::LinesAtRootEnum::exLinesAtRoot; Grid1->Background[Exgridlib_tlb::BackgroundPartEnum::exBackColorFilter] = RGB(255,255,255); Exgridlib_tlb::IColumnPtr var_Column = Grid1->Columns->Add(L"Items"); var_Column->DisplayFilterButton = true; var_Column->DisplayFilterPattern = false; var_Column->FilterList = Exgridlib_tlb::FilterListEnum::exShowFocusItem | Exgridlib_tlb::FilterListEnum::exShowCheckBox | Exgridlib_tlb::FilterListEnum::exSortItemsAsc | Exgridlib_tlb::FilterListEnum::exLeafItems; Exgridlib_tlb::IItemsPtr var_Items = Grid1->Items; long h = var_Items->AddItem(TVariant("Root 1")); var_Items->InsertItem(h,TNoParam(),TVariant("Child 1")); var_Items->InsertItem(h,TNoParam(),TVariant("Child 2")); var_Items->set_ExpandItem(h,true); h = var_Items->AddItem(TVariant("Root 2")); var_Items->InsertItem(h,TNoParam(),TVariant("Child 1")); var_Items->InsertItem(h,TNoParam(),TVariant("Child 2")); var_Items->InsertItem(h,TNoParam(),TVariant("Child 3")); var_Items->set_ExpandItem(h,true); Grid1->EndUpdate(); |
884 |
I am using AllowGroupBy property and calling the Column.SortOrder property groups by that column. Is it possible to prevent that, so I have a similar behavior like I click the column's header rather than dragging it to the control's GroupBy bar
|
883 |
Calling programatically the Column.SortOrder property adds the column to the sort bar. Is it possible to prevent that, so I have a similar behavior like I click the column's header rather than dragging it to the control's Sort bar
|
882 |
How do I restore/clear the HotBackColor/HotForeColor properties
Grid1->BeginUpdate(); Grid1->HotBackColor = RGB(0,0,255); Grid1->HotForeColor = RGB(255,255,255); Grid1->Columns->Add(L"Value")->Visible = false; Exgridlib_tlb::IColumnPtr var_Column = Grid1->Columns->Add(L"USD"); var_Column->set_Def(Exgridlib_tlb::DefColumnEnum::exCellValueFormat,TVariant(1)); var_Column->FormatColumn = L"len(%0) ? ((0:=dbl(%0)) < 10 ? '<fgcolor=808080><font ;7>' : '<b>') + `USD `+ (=:0 format ``)"; Exgridlib_tlb::IColumnPtr var_Column1 = Grid1->Columns->Add(L"EUR"); var_Column1->set_Def(Exgridlib_tlb::DefColumnEnum::exCellValueFormat,TVariant(1)); var_Column1->FormatColumn = L"len(%0) ? ((0:=0.72*dbl(%0)) < 10 ? '<fgcolor=808080><font ;7>' : '<b>') + `EUR `+ (=:0 format ``)"; Exgridlib_tlb::IItemsPtr var_Items = Grid1->Items; var_Items->AddItem(TVariant("1.23")); var_Items->AddItem(TVariant("2.34")); var_Items->AddItem(TVariant("9.94")); var_Items->AddItem(TVariant("11.94")); var_Items->AddItem(TVariant("1000")); Grid1->HotBackColor = Grid1->BackColor; Grid1->HotForeColor = Grid1->ForeColor; Grid1->EndUpdate(); |
881 |
How do I format a column using a currency, and another column to another currency
Grid1->Columns->Add(L"Value")->Visible = false; Exgridlib_tlb::IColumnPtr var_Column = Grid1->Columns->Add(L"USD"); var_Column->set_Def(Exgridlib_tlb::DefColumnEnum::exCellValueFormat,TVariant(1)); var_Column->FormatColumn = L"len(%0) ? ((0:=dbl(%0)) < 10 ? '<fgcolor=808080><font ;7>' : '<b>') + `USD `+ (=:0 format ``)"; Exgridlib_tlb::IColumnPtr var_Column1 = Grid1->Columns->Add(L"EUR"); var_Column1->set_Def(Exgridlib_tlb::DefColumnEnum::exCellValueFormat,TVariant(1)); var_Column1->FormatColumn = L"len(%0) ? ((0:=0.72*dbl(%0)) < 10 ? '<fgcolor=808080><font ;7>' : '<b>') + `EUR `+ (=:0 format ``)"; Exgridlib_tlb::IItemsPtr var_Items = Grid1->Items; var_Items->AddItem(TVariant("1.23")); var_Items->AddItem(TVariant("2.34")); var_Items->AddItem(TVariant("9.94")); var_Items->AddItem(TVariant("11.94")); var_Items->AddItem(TVariant("1000")); |
880 |
How can I sort the columns to be displayed on the columns floating bar
|
879 |
How can I get the column index and the row index of the active cell
// FocusChanged event - Occurs when a new cell is focused. void __fastcall TForm1::Grid1FocusChanged(TObject *Sender) { OutputDebugString( L"Active/Focus-Column:" ); OutputDebugString( Grid1->Columns->get_Item(TVariant(Grid1->FocusColumnIndex))->Caption ); Exgridlib_tlb::IItemsPtr var_Items = Grid1->Items; OutputDebugString( L"Active/Focus-Row/Item:" ); OutputDebugString( var_Items->get_CellCaption(TVariant(var_Items->FocusItem),TVariant(Grid1->FocusColumnIndex)) ); } Grid1->BeginUpdate(); Exgridlib_tlb::IColumnsPtr var_Columns = Grid1->Columns; var_Columns->Add(L"C1")->Editor->EditType = Exgridlib_tlb::EditTypeEnum::EditType; var_Columns->Add(L"C2")->Editor->EditType = Exgridlib_tlb::EditTypeEnum::EditType; var_Columns->Add(L"C3")->Editor->EditType = Exgridlib_tlb::EditTypeEnum::EditType; Exgridlib_tlb::IItemsPtr var_Items = Grid1->Items; long h = var_Items->AddItem(TVariant(1)); var_Items->set_CellValue(TVariant(h),TVariant(1),TVariant(2)); var_Items->set_CellValue(TVariant(h),TVariant(2),TVariant(3)); h = var_Items->AddItem(TVariant(3)); var_Items->set_CellValue(TVariant(h),TVariant(1),TVariant(1)); var_Items->set_CellValue(TVariant(h),TVariant(2),TVariant(2)); Grid1->EndUpdate(); |
878 |
How can I add a vertical padding
Grid1->BeginUpdate(); Grid1->DrawGridLines = Exgridlib_tlb::GridLinesEnum::exAllLines; Exgridlib_tlb::IColumnPtr var_Column = Grid1->Columns->Add(L"Padding"); var_Column->set_Def(Exgridlib_tlb::DefColumnEnum::exCellHasCheckBox,TVariant(true)); var_Column->set_Def(Exgridlib_tlb::DefColumnEnum::exCellSingleLine,TVariant(false)); var_Column->set_Def(Exgridlib_tlb::DefColumnEnum::exCellPaddingLeft,TVariant(6)); var_Column->set_Def(Exgridlib_tlb::DefColumnEnum::exCellPaddingRight,TVariant(6)); var_Column->set_Def(Exgridlib_tlb::DefColumnEnum::exCellPaddingTop,TVariant(6)); var_Column->set_Def(Exgridlib_tlb::DefColumnEnum::exCellPaddingBottom,TVariant(6)); Exgridlib_tlb::IItemsPtr var_Items = Grid1->Items; var_Items->AddItem(TVariant("padding")); var_Items->AddItem(TVariant("padding")); Grid1->EndUpdate(); |
877 |
How can I set item's height individually for every item in the control and also have line breaks in the item caption
Grid1->BackColorAlternate = RGB(240,240,240); Exgridlib_tlb::IColumnPtr var_Column = Grid1->Columns->Add(L"Lines"); var_Column->set_Def(Exgridlib_tlb::DefColumnEnum::exCellValueFormat,TVariant(1)); var_Column->set_Def(Exgridlib_tlb::DefColumnEnum::exCellSingleLine,TVariant(false)); Grid1->ItemsAllowSizing = Exgridlib_tlb::ItemsAllowSizingEnum::exResizeItem; Exgridlib_tlb::IItemsPtr var_Items = Grid1->Items; long h = var_Items->AddItem(TVariant("Line 1<br>Line 2")); var_Items->set_ItemMinHeight(h,36); var_Items->set_ItemHeight(h,var_Items->get_ItemMinHeight(h)); var_Items->set_ItemMaxHeight(h,var_Items->get_ItemMinHeight(h)); h = var_Items->AddItem(TVariant("Line 1<br>Line 2")); var_Items->set_ItemMinHeight(h,48); var_Items->set_ItemHeight(h,var_Items->get_ItemMinHeight(h)); var_Items->set_ItemMaxHeight(h,var_Items->get_ItemMinHeight(h)); h = var_Items->AddItem(TVariant("Line 1<br>Line 2")); var_Items->set_ItemMinHeight(h,64); var_Items->set_ItemHeight(h,var_Items->get_ItemMinHeight(h)); var_Items->set_ItemMaxHeight(h,var_Items->get_ItemMinHeight(h)); |
876 |
The mouse-cursor is shown over the tooltip. Is it possible somehow resolve this (method 2)
// MouseMove event - Occurs when the user moves the mouse. void __fastcall TForm1::Grid1MouseMove(TObject *Sender,short Button,short Shift,int X,int Y) { Grid1->ShowToolTip(L"This is bit of text that's shown when the user hovers the cell",TVariant("Column"),TVariant(0),TVariant("+16"),TVariant("+16")); } Grid1->Columns->Add(L"Column"); Exgridlib_tlb::IItemsPtr var_Items = Grid1->Items; var_Items->AddItem(TVariant("tooltip")); |
875 |
The mouse-cursor is shown over the tooltip. Is it possible somehow resolve this (method 1)
|
874 |
How can I add a MIN or MAX field (for date)
Grid1->BeginUpdate(); Grid1->Columns->Add(L"Text")->SortType = Exgridlib_tlb::SortTypeEnum::SortDate; Exgridlib_tlb::IItemsPtr var_Items = Grid1->Items; var_Items->AddItem(TVariant(TDateTime(2001,1,1).operator double())); var_Items->AddItem(TVariant(TDateTime(1998,12,11).operator double())); var_Items->AddItem(TVariant(TDateTime(2014,1,20).operator double())); var_Items->AddItem(TVariant(TDateTime(2013,1,1).operator double())); long h = var_Items->AddItem(TVariant("min(all,dir,date(%0))")); var_Items->set_SortableItem(h,false); var_Items->set_CellValueFormat(TVariant(h),TVariant(0),Exgridlib_tlb::ValueFormatEnum::exTotalField); var_Items->set_CellHAlignment(TVariant(h),TVariant(0),Exgridlib_tlb::AlignmentEnum::RightAlignment); var_Items->set_FormatCell(TVariant(h),TVariant(0),L"'MIN: '+value"); h = var_Items->AddItem(TVariant("max(all,dir,date(%0))")); var_Items->set_SortableItem(h,false); var_Items->set_CellValueFormat(TVariant(h),TVariant(0),Exgridlib_tlb::ValueFormatEnum::exTotalField); var_Items->set_CellHAlignment(TVariant(h),TVariant(0),Exgridlib_tlb::AlignmentEnum::RightAlignment); var_Items->set_FormatCell(TVariant(h),TVariant(0),L"'MAX: '+value"); Grid1->EndUpdate(); |
873 |
How can I add a MIN or MAX field (for text)
Grid1->BeginUpdate(); Grid1->Columns->Add(L"Text")->SortType = Exgridlib_tlb::SortTypeEnum::SortString; Exgridlib_tlb::IItemsPtr var_Items = Grid1->Items; var_Items->AddItem(TVariant("aha")); var_Items->AddItem(TVariant("baba")); var_Items->AddItem(TVariant("aaha")); var_Items->AddItem(TVariant("aka")); long h = var_Items->AddItem(TVariant("min(all,dir,str(%0))")); var_Items->set_SortableItem(h,false); var_Items->set_CellValueFormat(TVariant(h),TVariant(0),Exgridlib_tlb::ValueFormatEnum::exTotalField); var_Items->set_CellHAlignment(TVariant(h),TVariant(0),Exgridlib_tlb::AlignmentEnum::RightAlignment); var_Items->set_FormatCell(TVariant(h),TVariant(0),L"'MIN: '+value"); h = var_Items->AddItem(TVariant("max(all,dir,str(%0))")); var_Items->set_SortableItem(h,false); var_Items->set_CellValueFormat(TVariant(h),TVariant(0),Exgridlib_tlb::ValueFormatEnum::exTotalField); var_Items->set_CellHAlignment(TVariant(h),TVariant(0),Exgridlib_tlb::AlignmentEnum::RightAlignment); var_Items->set_FormatCell(TVariant(h),TVariant(0),L"'MAX: '+value"); Grid1->EndUpdate(); |
872 |
How can I change the the focus rectangle
Grid1->BeginUpdate(); Grid1->VisualAppearance->Add(1,TVariant(String("gBFLBCJwBAEHhEJAAEhABeEGACAADACAxRDgMQBQKAAzQFAYbBlBaERiGQYIJhUAIIRZGMQxXAcMQvDSKQJhGDAADENAxAJCI4DBIgZQNDwZQIkCY4ZDKHIfRzNAASJ") + "IkTQPBKfYDGOLhSh6IJGRpPEIxdJMBr+fZ9QApeoYVj2J4eUCAFBxDRsZw8BiNAbkOi4Jp1f5nVJaFSxCKoSxbNqSBpGCzoJrKdI0R5JES2BAddTLBKzX7tHArLgSJ5d" + "SrLMrwSKcRR1HSbIDyGaMUiCSqGVjWNZ5FREM46AAGbDgMILEgOZpoYDFVTZTKFCS7I6Eb40CCbCyPJQAabgWo4KAAZThNi7QAua4bTr7HqibLAexaJDOc4HVSgMLlIY" + "EkIeg2iybAjDkfhMFuHY7mQT4xB0TBnFoUQ6i+cg2j2SIvHqVZIl8cB+BwTgPA4NRdjycg2FoHhuAMUZuHGUAwCECQUAaEYMHQHRHCGFRZEQAABO2AwRFCWQJAoGxECW" + "TBHkGBxpg8RhYBMbJbD+TBzByfwwAwCIOCWCQiGiJgogqYh4hYIQ/k2cx9gEYQAAiRgqgsYx4mYLIOiOCMjjCTA4iScw8mMOQWEaEZkGkDgpguUIYm4SITmUCQaDuExj" + "gkRhWhQJQ0A4ToVmWSQWFkAAljkdhiheZgZgoXIZCUWYaF2GgihmKhrg4JRJjYboVmaSIiHOHQnAkahph2ZYJmQAAxAwSQKESHwkFkKgoiAIxIHoPIimOOg2DiCgoiQJ" + "RQTYQxwn8MgMgoMoPiaYoaGCfw4A4CJNAkOpcGQBCAg==")); Grid1->Background[Exgridlib_tlb::BackgroundPartEnum::exShowFocusRect] = 0x1000000; Exgridlib_tlb::IColumnPtr var_Column = Grid1->Columns->Add(L"Check"); var_Column->set_Def(Exgridlib_tlb::DefColumnEnum::exCellPaddingLeft,TVariant(2)); var_Column->set_Def(Exgridlib_tlb::DefColumnEnum::exCellHasCheckBox,TVariant(true)); Grid1->SelForeColor = Grid1->ForeColor; Grid1->SelBackColor = Grid1->BackColor; Grid1->DefaultItemHeight = 22; Grid1->ShowFocusRect = true; Exgridlib_tlb::IItemsPtr var_Items = Grid1->Items; var_Items->AddItem(TVariant("")); var_Items->AddItem(TVariant("")); Grid1->EndUpdate(); |
871 |
Can each cell have their own dropdown lists that contain "different list item values" for each cell, not predefined for the entire column
Grid1->BeginUpdate(); Exgridlib_tlb::IEditorPtr var_Editor = Grid1->Columns->Add(L"Column/Cell-Same")->Editor; var_Editor->EditType = Exgridlib_tlb::EditTypeEnum::DropDownListType; var_Editor->AddItem(0,L"Zero",TNoParam()); var_Editor->AddItem(1,L"One",TNoParam()); var_Editor->AddItem(2,L"Two",TNoParam()); Exgridlib_tlb::IEditorPtr var_Editor1 = Grid1->Columns->Add(L"Column/Cell-Different")->Editor; var_Editor1->EditType = Exgridlib_tlb::EditTypeEnum::EditType; Exgridlib_tlb::IItemsPtr var_Items = Grid1->Items; var_Items->AddItem(TNoParam()); long h = var_Items->AddItem(TVariant(0)); Exgridlib_tlb::IEditorPtr var_Editor2 = var_Items->get_CellEditor(TVariant(h),TVariant(1)); var_Editor2->EditType = Exgridlib_tlb::EditTypeEnum::DropDownListType; var_Editor2->AddItem(3,L"Three",TNoParam()); var_Editor2->AddItem(4,L"Four",TNoParam()); var_Items->set_CellValue(TVariant(h),TVariant(1),TVariant(3)); var_Items->AddItem(TNoParam()); h = var_Items->AddItem(TVariant(0)); Exgridlib_tlb::IEditorPtr var_Editor3 = var_Items->get_CellEditor(TVariant(h),TVariant(1)); var_Editor3->EditType = Exgridlib_tlb::EditTypeEnum::CheckListType; var_Editor3->AddItem(1,L"Single",TNoParam()); var_Editor3->AddItem(2,L"Double",TNoParam()); var_Items->set_CellValue(TVariant(h),TVariant(1),TVariant(3)); Grid1->EndUpdate(); |
870 |
How can I specify just a few fonts in a FontType editor
Grid1->BeginUpdate(); Grid1->DefaultItemHeight = 22; Grid1->DrawGridLines = Exgridlib_tlb::GridLinesEnum::exRowLines; Exgridlib_tlb::IEditorPtr var_Editor = Grid1->Columns->Add(L"Fonts")->Editor; var_Editor->EditType = Exgridlib_tlb::EditTypeEnum::FontType; var_Editor->ClearItems(); var_Editor->AddItem(0,L"Calibri",TNoParam()); var_Editor->AddItem(1,L"Arial",TNoParam()); var_Editor->AddItem(2,L"Rockwell",TNoParam()); var_Editor->AddItem(3,L"Tahoma",TNoParam()); var_Editor->SortItems(TVariant(true),TNoParam()); var_Editor->DropDownRows = 4; Exgridlib_tlb::IItemsPtr var_Items = Grid1->Items; var_Items->AddItem(TVariant("Tahoma")); Grid1->EndUpdate(); |
869 |
How do you embed HTML options into the anchor click string
// AnchorClick event - Occurs when an anchor element is clicked. void __fastcall TForm1::Grid1AnchorClick(TObject *Sender,BSTR AnchorID,BSTR Options) { OutputDebugString( L"AnchorID" ); OutputDebugString( L"Options" ); } Grid1->BeginUpdate(); Exgridlib_tlb::IColumnsPtr var_Columns = Grid1->Columns; var_Columns->Add(L"Car")->set_Def(Exgridlib_tlb::DefColumnEnum::exCellValueFormat,TVariant(1)); Exgridlib_tlb::IItemsPtr var_Items = Grid1->Items; var_Items->AddItem(TVariant("<a mazda_1;options for 1>Mazda <b>1</b></a>")); var_Items->AddItem(TVariant("<a mazda_2;options for 2>Mazda <b>2</b></a>")); var_Items->AddItem(TVariant("<a mazda_3;options for 3a>Mazda <b>3.a</b></a>")); var_Items->AddItem(TVariant("<a mazda_3;options for 3b>Mazda <b>3.b</b></a>")); Grid1->EndUpdate(); |
868 |
How do I add a checkbox column (method 2)
// CellStateChanged event - Fired after cell's state has been changed. void __fastcall TForm1::Grid1CellStateChanged(TObject *Sender,Exgridlib_tlb::HITEM Item,long ColIndex) { OutputDebugString( L"CheckBox Changed:" ); OutputDebugString( PChar(Grid1->Items->get_CellState(TVariant(Item),TVariant(ColIndex))) ); } Grid1->BeginUpdate(); Grid1->Columns->Add(L"Check")->set_Def(Exgridlib_tlb::DefColumnEnum::exCellHasCheckBox,TVariant(true)); Exgridlib_tlb::IItemsPtr var_Items = Grid1->Items; var_Items->set_CellState(TVariant(var_Items->AddItem(TVariant("Check 1"))),TVariant(0),0); var_Items->set_CellState(TVariant(var_Items->AddItem(TVariant("Check 2"))),TVariant(0),1); var_Items->set_CellState(TVariant(var_Items->AddItem(TVariant("Check 3"))),TVariant(0),0); var_Items->set_CellState(TVariant(var_Items->AddItem(TVariant("Check 4"))),TVariant(0),1); Grid1->EndUpdate(); |
867 |
How do I add a checkbox column (method 1)
// Change event - Occurs when the user changes the cell's content. void __fastcall TForm1::Grid1Change(TObject *Sender,Exgridlib_tlb::HITEM Item,long ColIndex,Variant * NewValue) { OutputDebugString( L"CheckBox Changed:" ); OutputDebugString( L"NewValue" ); } Grid1->BeginUpdate(); Exgridlib_tlb::IColumnPtr var_Column = Grid1->Columns->Add(L"Check"); Exgridlib_tlb::IEditorPtr var_Editor = var_Column->Editor; var_Editor->EditType = Exgridlib_tlb::EditTypeEnum::CheckValueType; var_Editor->set_Option(Exgridlib_tlb::EditorOptionEnum::exCheckValue2,TVariant(1)); Exgridlib_tlb::IItemsPtr var_Items = Grid1->Items; var_Items->AddItem(TVariant(0)); var_Items->AddItem(TVariant(1)); var_Items->AddItem(TVariant(0)); var_Items->AddItem(TVariant(1)); Grid1->EndUpdate(); |
866 |
How do I change the progress bar's appearance
Exgridlib_tlb::IAppearancePtr var_Appearance = Grid1->VisualAppearance; var_Appearance->Add(1,TVariant("c:\\exontrol\\images\\normal.ebn")); var_Appearance->Add(2,TVariant("c:\\exontrol\\images\\pushed.ebn")); Exgridlib_tlb::IEditorPtr var_Editor = Grid1->Columns->Add(L"Progress")->Editor; var_Editor->EditType = Exgridlib_tlb::EditTypeEnum::ProgressBarType; var_Editor->set_Option(Exgridlib_tlb::EditorOptionEnum::exProgressBarBackColor,TVariant(16777216)); var_Editor->set_Option(Exgridlib_tlb::EditorOptionEnum::exProgressBarMarkTicker,TVariant(33554432)); Grid1->Items->AddItem(TVariant(33)); |
865 |
I have the rows with different background color, and when I select the item it takes the color of the SelBackColor, and therefore is no longer visible behind the color. Is there any option to make the item's color being visible (method 3)
Grid1->BeginUpdate(); Grid1->VisualAppearance->Add(1,TVariant(String("gBFLBCJwBAEHhEJAEGg4BVEIQAAYAQGKIYBkAKBQAGaAoDDMOQwQwAAxjGKEEwsACEIrjKCRShyCYZRhGcTSBCIZBqEqSZLiEZRQCWIAzATGYBRfIUEgjBM6ExwG78e") + "gBHp/ZpkACIJJAaRjHQdJxGKKMQB9DIhCZpeKhWgkKIJBzOEyBRC4ERBGqNGrsIgLEqWZpnWhaNpWXYTLyBN64LhuK46g53O6wLxvK6hEr2dJ/YBcIAOfghf4NQ7EMRx" + "LC8Mw3BDvYDkOAABAIgI=")); Grid1->SelBackColor = 0x1fffffe; Grid1->ShowFocusRect = false; Grid1->Columns->Add(L"Items"); Exgridlib_tlb::IItemsPtr var_Items = Grid1->Items; var_Items->set_ItemBackColor(var_Items->AddItem(TVariant("red")),RGB(255,0,0)); var_Items->set_ItemBackColor(var_Items->AddItem(TVariant("blue")),RGB(0,0,255)); var_Items->set_ItemBackColor(var_Items->AddItem(TVariant("green")),RGB(0,255,0)); Grid1->EndUpdate(); |
864 |
I have the rows with different background color, and when I select the item it takes the color of the SelBackColor, and therefore is no longer visible behind the color. Is there any option to make the item's color being visible (method 2)
Grid1->BeginUpdate(); Grid1->SelBackMode = Exgridlib_tlb::BackModeEnum::exTransparent; Grid1->ShowFocusRect = false; Grid1->Columns->Add(L"Items"); Exgridlib_tlb::IItemsPtr var_Items = Grid1->Items; var_Items->set_ItemBackColor(var_Items->AddItem(TVariant("red")),RGB(255,0,0)); var_Items->set_ItemBackColor(var_Items->AddItem(TVariant("blue")),RGB(0,0,255)); var_Items->set_ItemBackColor(var_Items->AddItem(TVariant("green")),RGB(0,255,0)); Grid1->EndUpdate(); |
863 |
I have the rows with different background color, and when I select the item it takes the color of the SelBackColor, and therefore is no longer visible behind the color. Is there any option to make the item's color being visible (method 1)
Grid1->BeginUpdate(); Grid1->SelBackColor = Grid1->BackColor; Grid1->SelForeColor = Grid1->ForeColor; Grid1->ShowFocusRect = true; Grid1->Columns->Add(L"Items"); Exgridlib_tlb::IItemsPtr var_Items = Grid1->Items; var_Items->set_ItemBackColor(var_Items->AddItem(TVariant("red")),RGB(255,0,0)); var_Items->set_ItemBackColor(var_Items->AddItem(TVariant("blue")),RGB(0,0,255)); var_Items->set_ItemBackColor(var_Items->AddItem(TVariant("green")),RGB(0,255,0)); Grid1->EndUpdate(); |
862 |
The BeforeExpandItem event is fired when clicking the drop down filter button. What we can do to prevent that
// BeforeExpandItem event - Fired before an item is about to be expanded (collapsed). void __fastcall TForm1::Grid1BeforeExpandItem(TObject *Sender,Exgridlib_tlb::HITEM Item,Variant * Cancel) { OutputDebugString( L"BeforeExpandItem" ); OutputDebugString( L"Item" ); Grid1->Items->InsertItem(Item,TNoParam(),TVariant("new child")); } Grid1->BeginUpdate(); Grid1->LinesAtRoot = Exgridlib_tlb::LinesAtRootEnum::exLinesAtRoot; Exgridlib_tlb::IColumnsPtr var_Columns = Grid1->Columns; Exgridlib_tlb::IColumnPtr var_Column = var_Columns->Add(L"Items"); var_Column->DisplayFilterButton = true; var_Column->FilterList = Exgridlib_tlb::FilterListEnum::exRootItems; Exgridlib_tlb::IItemsPtr var_Items = Grid1->Items; var_Items->set_ItemHasChildren(var_Items->InsertItem(TNoParam(),TNoParam(),TVariant("Group 1")),true); var_Items->set_ItemHasChildren(var_Items->InsertItem(TNoParam(),TNoParam(),TVariant("Group 2")),true); Grid1->EndUpdate(); |
861 |
How can I change the shape of the line to be shown when user drag and drop data over the control, EBN
// OLEStartDrag event - Occurs when the OLEDrag method is called. void __fastcall TForm1::Grid1OLEStartDrag(TObject *Sender,Exgridlib_tlb::IExDataObject *Data,long * AllowedEffects) { // Data.SetData("data to be dragged") } Grid1->OLEDropMode = Exgridlib_tlb::exOLEDropModeEnum::exOLEDropManual; Grid1->VisualAppearance->Add(1,TVariant("C:\\Program Files\\Exontrol\\ExList\\Sample\\VB\\DragDrop\\insert_bottom.ebn")); Grid1->Background[Exgridlib_tlb::BackgroundPartEnum::exListOLEDropPosition] = 0x1000000; Grid1->Columns->Add(L"Default"); Exgridlib_tlb::IItemsPtr var_Items = Grid1->Items; var_Items->AddItem(TVariant("Item 1")); var_Items->AddItem(TVariant("Item 2")); |
860 |
How can I highlight the item from cursor when the user drag and drop data over the control
// OLEStartDrag event - Occurs when the OLEDrag method is called. void __fastcall TForm1::Grid1OLEStartDrag(TObject *Sender,Exgridlib_tlb::IExDataObject *Data,long * AllowedEffects) { // Data.SetData("data to be dragged") } Grid1->OLEDropMode = Exgridlib_tlb::exOLEDropModeEnum::exOLEDropManual; Grid1->Background[Exgridlib_tlb::BackgroundPartEnum::exListOLEDropPosition] = RGB(1,0,0); Grid1->Columns->Add(L"Default"); Exgridlib_tlb::IItemsPtr var_Items = Grid1->Items; var_Items->AddItem(TVariant("Item 1")); var_Items->AddItem(TVariant("Item 2")); |
859 |
Is it possible to always show the editor for all cells at all times
// AddItem event - Occurs after a new Item has been inserted to Items collection. void __fastcall TForm1::Grid1AddItem(TObject *Sender,Exgridlib_tlb::HITEM Item) { Grid1->Items->set_CellEditorVisible(TVariant(Item),TVariant(0),Exgridlib_tlb::EditorVisibleEnum::exEditorVisible); Grid1->Items->set_CellEditorVisible(TVariant(Item),TVariant(1),Exgridlib_tlb::EditorVisibleEnum::exEditorVisible); } // EditOpen event - Occurs when the edit operation starts. void __fastcall TForm1::Grid1EditOpen(TObject *Sender) { Exgridlib_tlb::IItemsPtr var_Items = Grid1->Items; TVariant v = TVariant(var_Items->get_CellValue(TVariant(var_Items->FocusItem),TVariant(0))); String c = var_Items->get_CellCaption(TVariant(var_Items->FocusItem),TVariant(0)); Exgridlib_tlb::IEditorPtr var_Editor = Grid1->Columns->get_Item(TVariant(1))->Editor; var_Editor->ClearItems(); var_Editor->AddItem(v,L"c",TNoParam()); } Grid1->BeginUpdate(); Exgridlib_tlb::IColumnPtr var_Column = Grid1->Columns->Add(L"DropDownList"); Exgridlib_tlb::IEditorPtr var_Editor = var_Column->Editor; var_Editor->EditType = Exgridlib_tlb::EditTypeEnum::DropDownListType; var_Editor->AddItem(1,L"First",TNoParam()); var_Editor->AddItem(2,L"Second",TNoParam()); var_Editor->AddItem(3,L"Third",TNoParam()); Grid1->DrawGridLines = Exgridlib_tlb::GridLinesEnum::exAllLines; Grid1->Columns->Add(L"DropDownList-Related")->Editor->EditType = Exgridlib_tlb::EditTypeEnum::DropDownListType; Exgridlib_tlb::IItemsPtr var_Items = Grid1->Items; var_Items->set_CellValue(TVariant(var_Items->AddItem(TVariant(1))),TVariant(1),TVariant(-1)); var_Items->set_CellValue(TVariant(var_Items->AddItem(TVariant(2))),TVariant(1),TVariant(-1)); var_Items->set_CellValue(TVariant(var_Items->AddItem(TVariant(3))),TVariant(1),TVariant(-1)); var_Items->set_LockedItemCount(Exgridlib_tlb::VAlignmentEnum::exBottom,1); long h = var_Items->get_LockedItem(Exgridlib_tlb::VAlignmentEnum::exBottom,0); var_Items->set_ItemDivider(h,0); var_Items->set_ItemDividerLineAlignment(h,Exgridlib_tlb::DividerAlignmentEnum::DividerTop); var_Items->set_CellEditorVisible(TVariant(h),TVariant(0),Exgridlib_tlb::EditorVisibleEnum::exEditorHidden); var_Items->set_CellSingleLine(TVariant(h),TVariant(0),Exgridlib_tlb::CellSingleLineEnum::exCaptionWordWrap); var_Items->set_CellValueFormat(TVariant(h),TVariant(0),Exgridlib_tlb::ValueFormatEnum::exHTML); var_Items->set_CellValue(TVariant(h),TVariant(0),TVariant(String("The drop down editor in the second column is filled during the <b>EditOpen event</b>, and the values are based on the selection") + " on the first column.")); Grid1->EndUpdate(); |
858 |
How do I set a computated cell individually
Grid1->BeginUpdate(); Grid1->Columns->Add(L"Number"); Grid1->Columns->Add(L"Format"); Exgridlib_tlb::IItemsPtr var_Items = Grid1->Items; long h = var_Items->AddItem(TVariant("1.23")); var_Items->set_CellValueFormat(TVariant(h),TVariant(1),Exgridlib_tlb::ValueFormatEnum::exComputedField | Exgridlib_tlb::ValueFormatEnum::exHTML); var_Items->set_CellValue(TVariant(h),TVariant(1),TVariant("2 * %0 + ` <font ;6><fgcolor=808080>(2 * Number)`")); h = var_Items->AddItem(TVariant("1.23")); var_Items->set_CellValueFormat(TVariant(h),TVariant(1),Exgridlib_tlb::ValueFormatEnum::exComputedField | Exgridlib_tlb::ValueFormatEnum::exHTML); var_Items->set_CellValue(TVariant(h),TVariant(1),TVariant("3 * %0 + ` <font ;6><fgcolor=808080>(3 * Number)`")); h = var_Items->AddItem(TVariant("1.23")); var_Items->set_CellValueFormat(TVariant(h),TVariant(1),Exgridlib_tlb::ValueFormatEnum::exComputedField | Exgridlib_tlb::ValueFormatEnum::exHTML); var_Items->set_CellValue(TVariant(h),TVariant(1),TVariant("currency(%0) + ` <font ;6><fgcolor=808080>( Currency(Number) )`")); Grid1->EndUpdate(); |
857 |
Is it possible to assign a different editor for some cells
Exgridlib_tlb::IEditorPtr var_Editor = Grid1->Columns->Add(L"Column - DropDownList")->Editor; var_Editor->EditType = Exgridlib_tlb::EditTypeEnum::DropDownListType; var_Editor->AddItem(1,L"First item",TNoParam()); var_Editor->AddItem(2,L"Second item",TNoParam()); var_Editor->AddItem(3,L"Third item",TNoParam()); Grid1->Columns->Add(L"Cell - DropDownList")->set_Def(Exgridlib_tlb::DefColumnEnum::exCellValueFormat,TVariant(1)); Exgridlib_tlb::IItemsPtr var_Items = Grid1->Items; long h = var_Items->AddItem(TVariant(1)); Exgridlib_tlb::IEditorPtr var_Editor1 = var_Items->get_CellEditor(TVariant(h),TVariant(1)); var_Editor1->EditType = Exgridlib_tlb::EditTypeEnum::DropDownListType; var_Editor1->AddItem(1,L"<b>First</b> item",TNoParam()); var_Editor1->AddItem(2,L"<b>Second</b> item",TNoParam()); var_Editor1->AddItem(3,L"<b>Third</b> item",TNoParam()); var_Editor1->AddItem(4,L"<b>Forth</b> item",TNoParam()); var_Items->set_CellValue(TVariant(h),TVariant(1),TVariant(2)); h = var_Items->AddItem(TVariant(2)); Exgridlib_tlb::IEditorPtr var_Editor2 = var_Items->get_CellEditor(TVariant(h),TVariant(1)); var_Editor2->EditType = Exgridlib_tlb::EditTypeEnum::DropDownListType; var_Editor2->AddItem(1,L"<b>Aka First</b> item",TNoParam()); var_Editor2->AddItem(2,L"<b>Aka Second</b> item",TNoParam()); var_Editor2->AddItem(3,L"<b>Aka Third</b> item",TNoParam()); var_Editor2->AddItem(4,L"<b>Aka Forth</b> item",TNoParam()); var_Items->set_CellValue(TVariant(h),TVariant(1),TVariant(2)); |
856 |
Is it possible to define the keys of the drop down values to be strings rather than numeric values
// Change event - Occurs when the user changes the cell's content. void __fastcall TForm1::Grid1Change(TObject *Sender,Exgridlib_tlb::HITEM Item,long ColIndex,Variant * NewValue) { OutputDebugString( L"NewValue is" ); OutputDebugString( L"NewValue" ); } Exgridlib_tlb::IEditorPtr var_Editor = Grid1->Columns->Add(L"DropDownList-String")->Editor; var_Editor->EditType = Exgridlib_tlb::EditTypeEnum::DropDownListType; var_Editor->AddItem(1,L"NYC|New York City",TNoParam()); var_Editor->AddItem(2,L"CJN|Cluj Napoca",TNoParam()); Exgridlib_tlb::IEditorPtr var_Editor1 = Grid1->Columns->Add(L"DropDownList-Numeric")->Editor; var_Editor1->EditType = Exgridlib_tlb::EditTypeEnum::DropDownListType; var_Editor1->AddItem(1,L"New York City",TNoParam()); var_Editor1->AddItem(2,L"Cluj Napoca",TNoParam()); Exgridlib_tlb::IItemsPtr var_Items = Grid1->Items; var_Items->set_CellValue(TVariant(var_Items->AddItem(TVariant("NYC"))),TVariant(1),TVariant(2)); |
855 |
The Change event gets me the today date. How can I find what user typed
// Change event - Occurs when the user changes the cell's content. void __fastcall TForm1::Grid1Change(TObject *Sender,Exgridlib_tlb::HITEM Item,long ColIndex,Variant * NewValue) { OutputDebugString( L"NewValue:" ); OutputDebugString( L"NewValue" ); OutputDebugString( L"EditingValue:" ); OutputDebugString( Grid1->EditingText ); } Grid1->BeginUpdate(); Grid1->Columns->Add(L"Edit")->Editor->EditType = Exgridlib_tlb::EditTypeEnum::DateType; Grid1->Items->AddItem(TVariant(TDateTime(2001,1,1).operator double())); Grid1->EndUpdate(); |
854 |
I have an edit field, when going to edit mode, the rightmost part is shown. Is it possible to show the left part instead
Grid1->BeginUpdate(); Exgridlib_tlb::IColumnPtr var_Column = Grid1->Columns->Add(L"Edit"); var_Column->Width = 64; var_Column->AllowSizing = false; Exgridlib_tlb::IEditorPtr var_Editor = var_Column->Editor; var_Editor->EditType = Exgridlib_tlb::EditTypeEnum::MaskType; var_Editor->Mask = L";;;rich"; Grid1->Columns->Add(L"Empty"); Exgridlib_tlb::IItemsPtr var_Items = Grid1->Items; var_Items->AddItem(TVariant("This is a bit ot long text")); var_Items->AddItem(TVariant("")); Grid1->EndUpdate(); |
853 |
I have a drop down field, the control shows the rightmost part of the selected caption. Is it possible to show the left part
Grid1->BeginUpdate(); Exgridlib_tlb::IColumnPtr var_Column = Grid1->Columns->Add(L"DropDown"); var_Column->Width = 64; var_Column->AllowSizing = false; Exgridlib_tlb::IEditorPtr var_Editor = var_Column->Editor; var_Editor->DropDownAlignment = Exgridlib_tlb::AlignmentEnum(0x20); var_Editor->EditType = Exgridlib_tlb::EditTypeEnum::DropDownType; var_Editor->AddItem(1,L"First item. This is a bit ot long text",TNoParam()); var_Editor->AddItem(2,L"Second item. This is a bit ot long text",TNoParam()); var_Editor->AddItem(3,L"Third item. This is a bit ot long text",TNoParam()); var_Editor->Mask = L";;;rich"; Exgridlib_tlb::IColumnPtr var_Column1 = Grid1->Columns->Add(L"PickEdit"); var_Column1->Width = 64; var_Column1->AllowSizing = false; Exgridlib_tlb::IEditorPtr var_Editor1 = var_Column1->Editor; var_Editor1->DropDownAlignment = Exgridlib_tlb::AlignmentEnum(0x20); var_Editor1->EditType = Exgridlib_tlb::EditTypeEnum::PickEditType; var_Editor1->AddItem(1,L"First item. This is a bit ot long text",TNoParam()); var_Editor1->AddItem(2,L"Second item. This is a bit ot long text",TNoParam()); var_Editor1->AddItem(3,L"Third item. This is a bit ot long text",TNoParam()); var_Editor1->Mask = L";;;rich"; Grid1->Columns->Add(L"Empty"); Exgridlib_tlb::IItemsPtr var_Items = Grid1->Items; var_Items->set_CellValue(TVariant(var_Items->AddItem(TVariant("First item. This is a bit ot long text"))),TVariant(1),TVariant("Second item. This is a bit ot long text")); long h = var_Items->AddItem(TVariant("First item. This is a bit ot long text")); Exgridlib_tlb::IEditorPtr var_Editor2 = var_Items->get_CellEditor(TVariant(h),TVariant(0)); var_Editor2->DropDownAlignment = Exgridlib_tlb::AlignmentEnum(0x20); var_Editor2->EditType = Exgridlib_tlb::EditTypeEnum::DropDownType; var_Editor2->AddItem(1,L"First item. This is a bit ot long text",TNoParam()); var_Editor2->AddItem(2,L"Second item. This is a bit ot long text",TNoParam()); var_Editor2->AddItem(3,L"Third item. This is a bit ot long text",TNoParam()); var_Items->set_CellValue(TVariant(h),TVariant(1),TVariant("Second item. This is a bit ot long text")); Exgridlib_tlb::IEditorPtr var_Editor3 = var_Items->get_CellEditor(TVariant(h),TVariant(1)); var_Editor3->DropDownAlignment = Exgridlib_tlb::AlignmentEnum(0x20); var_Editor3->EditType = Exgridlib_tlb::EditTypeEnum::PickEditType; var_Editor3->AddItem(1,L"First item. This is a bit ot long text",TNoParam()); var_Editor3->AddItem(2,L"Second item. This is a bit ot long text",TNoParam()); var_Editor3->AddItem(3,L"Third item. This is a bit ot long text",TNoParam()); Grid1->EndUpdate(); |
852 |
Is there a property for the back color of the dropdown field
Grid1->BeginUpdate(); Exgridlib_tlb::IEditorPtr var_Editor = Grid1->Columns->Add(L"Date")->Editor; var_Editor->EditType = Exgridlib_tlb::EditTypeEnum::DateType; var_Editor->set_Option(Exgridlib_tlb::EditorOptionEnum::exDropDownBackColor,TVariant(15790320)); var_Editor->set_Option(Exgridlib_tlb::EditorOptionEnum::exDropDownForeColor,TVariant(65793)); Grid1->Items->AddItem(TVariant(TDateTime(2001,1,1).operator double())); Grid1->EndUpdate(); |
851 |
Is it possible to change a back color of the field/cell when it takes a focus
// EditClose event - Occurs when the edit operation ends. void __fastcall TForm1::Grid1EditClose(TObject *Sender) { Exgridlib_tlb::IItemsPtr var_Items = Grid1->Items; var_Items->ClearCellBackColor(TVariant(var_Items->FocusItem),TVariant(Grid1->FocusColumnIndex)); } // EditOpen event - Occurs when the edit operation starts. void __fastcall TForm1::Grid1EditOpen(TObject *Sender) { Exgridlib_tlb::IItemsPtr var_Items = Grid1->Items; var_Items->set_CellBackColor(TVariant(var_Items->FocusItem),TVariant(Grid1->FocusColumnIndex),RGB(255,0,0)); Exgridlib_tlb::IItemsPtr var_Items1 = Grid1->Items; var_Items1->set_CellValue(TVariant(var_Items1->FocusItem),TVariant(Grid1->FocusColumnIndex),TVariant(Grid1->Items->get_CellValue(TVariant(Grid1->Items->FocusItem),TVariant(Grid1->FocusColumnIndex)))); } Grid1->FullRowSelect = Exgridlib_tlb::CellSelectEnum::exColumnSel; Grid1->Columns->Add(L"C1")->Editor->EditType = Exgridlib_tlb::EditTypeEnum::EditType; Grid1->Columns->Add(L"C2")->Editor->EditType = Exgridlib_tlb::EditTypeEnum::EditType; Exgridlib_tlb::IItemsPtr var_Items = Grid1->Items; var_Items->set_CellValue(TVariant(var_Items->AddItem(TVariant("v1"))),TVariant(1),TVariant("v2")); var_Items->set_CellValue(TVariant(var_Items->AddItem(TVariant("v3"))),TVariant(1),TVariant("v4")); |
850 |
How can I display the current date mask, but still allow empty values
Grid1->BeginUpdate(); Grid1->CauseValidateValue = Exgridlib_tlb::ValidateValueType::exValidateCell; Grid1->FullRowSelect = Exgridlib_tlb::CellSelectEnum::exColumnSel; Grid1->DrawGridLines = Exgridlib_tlb::GridLinesEnum::exRowLines; Exgridlib_tlb::IEditorPtr var_Editor = Grid1->Columns->Add(L"Date")->Editor; var_Editor->EditType = Exgridlib_tlb::EditTypeEnum::DateType; var_Editor->Mask = TVariant(String("!99/99/9999;1;;empty=1,validateas=1,invalid=Invalid date\\, for the input mask <br><b>'<%mask%>'</b>!,warning=Invalid character") + "!,select=4,overtype"); Exgridlib_tlb::IItemsPtr var_Items = Grid1->Items; var_Items->AddItem(TNoParam()); var_Items->AddItem(TVariant(TDateTime(2001,1,1).operator double())); var_Items->AddItem(TNoParam()); Grid1->EndUpdate(); |
849 |
How can I align the days in a DateType editor
Grid1->Columns->Add(L"DropDown"); Exgridlib_tlb::IItemsPtr var_Items = Grid1->Items; Exgridlib_tlb::IEditorPtr var_Editor = var_Items->get_CellEditor(TVariant(var_Items->AddItem(TVariant(TDateTime(2001,1,1).operator double()))),TVariant(0)); var_Editor->EditType = Exgridlib_tlb::EditTypeEnum::DateType; var_Editor->DropDownAlignment = Exgridlib_tlb::AlignmentEnum::RightAlignment; Exgridlib_tlb::IEditorPtr var_Editor1 = var_Items->get_CellEditor(TVariant(var_Items->AddItem(TVariant(TDateTime(2001,1,1).operator double()))),TVariant(0)); var_Editor1->EditType = Exgridlib_tlb::EditTypeEnum::DateType; var_Editor1->DropDownAlignment = Exgridlib_tlb::AlignmentEnum::CenterAlignment; Exgridlib_tlb::IEditorPtr var_Editor2 = var_Items->get_CellEditor(TVariant(var_Items->AddItem(TVariant(TDateTime(2001,1,1).operator double()))),TVariant(0)); var_Editor2->EditType = Exgridlib_tlb::EditTypeEnum::DateType; var_Editor2->DropDownAlignment = Exgridlib_tlb::AlignmentEnum::LeftAlignment; Exgridlib_tlb::IEditorPtr var_Editor3 = var_Items->get_CellEditor(TVariant(var_Items->AddItem(TVariant(TDateTime(2001,1,1).operator double()))),TVariant(0)); var_Editor3->EditType = Exgridlib_tlb::EditTypeEnum::DateType; var_Editor3->DropDownAlignment = Exgridlib_tlb::AlignmentEnum(0x20); Exgridlib_tlb::IEditorPtr var_Editor4 = var_Items->get_CellEditor(TVariant(var_Items->AddItem(TVariant(TDateTime(2001,1,1).operator double()))),TVariant(0)); var_Editor4->EditType = Exgridlib_tlb::EditTypeEnum::DateType; var_Editor4->DropDownAlignment = Exgridlib_tlb::AlignmentEnum(0x20 | Exgridlib_tlb::AlignmentEnum::CenterAlignment); Exgridlib_tlb::IEditorPtr var_Editor5 = var_Items->get_CellEditor(TVariant(var_Items->AddItem(TVariant(TDateTime(2001,1,1).operator double()))),TVariant(0)); var_Editor5->EditType = Exgridlib_tlb::EditTypeEnum::DateType; var_Editor5->DropDownAlignment = Exgridlib_tlb::AlignmentEnum(0x20 | Exgridlib_tlb::AlignmentEnum::RightAlignment); |
848 |
How can I align the drop down portion rather the inside captions
Grid1->Columns->Add(L"DropDown")->Editor->EditType = Exgridlib_tlb::EditTypeEnum::DateType; Exgridlib_tlb::IItemsPtr var_Items = Grid1->Items; Exgridlib_tlb::IEditorPtr var_Editor = var_Items->get_CellEditor(TVariant(var_Items->AddItem(TVariant(TDateTime(2001,1,1).operator double()))),TVariant(0)); var_Editor->EditType = Exgridlib_tlb::EditTypeEnum::DateType; var_Editor->DropDownAlignment = Exgridlib_tlb::AlignmentEnum(0x20); Exgridlib_tlb::IEditorPtr var_Editor1 = var_Items->get_CellEditor(TVariant(var_Items->AddItem(TVariant(TDateTime(2001,1,1).operator double()))),TVariant(0)); var_Editor1->EditType = Exgridlib_tlb::EditTypeEnum::DateType; var_Editor1->DropDownAlignment = Exgridlib_tlb::AlignmentEnum(0x10); var_Items->AddItem(TVariant(TDateTime(2001,1,1).operator double())); |
847 |
Is it possible to show a message that the field is empty
Grid1->DrawGridLines = Exgridlib_tlb::GridLinesEnum::exRowLines; Grid1->FullRowSelect = Exgridlib_tlb::CellSelectEnum::exColumnSel; Exgridlib_tlb::IColumnPtr var_Column = Grid1->Columns->Add(L"Float"); Exgridlib_tlb::IEditorPtr var_Editor = var_Column->Editor; var_Editor->EditType = Exgridlib_tlb::EditTypeEnum::MaskType; var_Editor->Mask = L";;;float,digits=0,grouping=,invalid=empty,warning=invalid character"; Grid1->Items->AddItem(TVariant(192278)); Grid1->Items->AddItem(TVariant(1000)); |
846 |
How can I mask a date
Grid1->BeginUpdate(); Grid1->CauseValidateValue = Exgridlib_tlb::ValidateValueType::exValidateCell; Grid1->FullRowSelect = Exgridlib_tlb::CellSelectEnum::exColumnSel; Grid1->DrawGridLines = Exgridlib_tlb::GridLinesEnum::exRowLines; Grid1->Columns->Add(L"Date"); Grid1->Columns->Add(L"Mask"); Exgridlib_tlb::IItemsPtr var_Items = Grid1->Items; long h = var_Items->AddItem(TVariant(TDateTime(2001,1,1).operator double())); Exgridlib_tlb::IEditorPtr var_Editor = var_Items->get_CellEditor(TVariant(h),TVariant(0)); var_Editor->EditType = Exgridlib_tlb::EditTypeEnum::DateType; var_Editor->Mask = TVariant(String("{1,12}/{1,31}/{1950,2050};1;;select=1,warning=Invalid character!,invalid=Invalid date\\, for the input mask <br><b>'<%mask%>'</") + "b>!,validateas=1"); var_Items->set_CellValue(TVariant(h),TVariant(1),TVariant(var_Items->get_CellEditor(TVariant(h),TVariant(0))->Mask)); h = var_Items->AddItem(TVariant(TDateTime(2001,1,1).operator double())); Exgridlib_tlb::IEditorPtr var_Editor1 = var_Items->get_CellEditor(TVariant(h),TVariant(0)); var_Editor1->EditType = Exgridlib_tlb::EditTypeEnum::DateType; var_Editor1->Mask = TVariant(String("!99/99/9999;1;;empty,validateas=1,invalid=Invalid date\\, for the input mask <br><b>'<%mask%>'</b>!,warning=Invalid character!,") + "select=4,overtype"); var_Items->set_CellValue(TVariant(h),TVariant(1),TVariant(var_Items->get_CellEditor(TVariant(h),TVariant(0))->Mask)); h = var_Items->AddItem(TVariant(TDateTime(2001,1,1).operator double())); Exgridlib_tlb::IEditorPtr var_Editor2 = var_Items->get_CellEditor(TVariant(h),TVariant(0)); var_Editor2->EditType = Exgridlib_tlb::EditTypeEnum::DateType; var_Editor2->Mask = TVariant(String("!99/99/9999;;;empty,validateas=1,invalid=Invalid date\\, for the input mask <br><b>'<%mask%>'</b>!,warning=Invalid character!,s") + "elect=4,overtype"); var_Items->set_CellValue(TVariant(h),TVariant(1),TVariant(var_Items->get_CellEditor(TVariant(h),TVariant(0))->Mask)); h = var_Items->AddItem(TVariant(TDateTime(2001,1,1).operator double())); Exgridlib_tlb::IEditorPtr var_Editor3 = var_Items->get_CellEditor(TVariant(h),TVariant(0)); var_Editor3->EditType = Exgridlib_tlb::EditTypeEnum::DateType; var_Editor3->Mask = TVariant(String("!99/99/9999;; ;select=4,overtype,empty,warning=Invalid character!,invalid=Invalid date\\, for the input mask <br><b>'<%mask%>'<") + "/b>!,validateas=1"); var_Items->set_CellValue(TVariant(h),TVariant(1),TVariant(var_Items->get_CellEditor(TVariant(h),TVariant(0))->Mask)); h = var_Items->AddItem(TVariant(TDateTime(2001,1,1).operator double())); Exgridlib_tlb::IEditorPtr var_Editor4 = var_Items->get_CellEditor(TVariant(h),TVariant(0)); var_Editor4->EditType = Exgridlib_tlb::EditTypeEnum::DateType; var_Editor4->Mask = TVariant(String("![0-9 ][0-9 ]/[0-9 ][0-9 ]/[0-9 ][0-9 ][0-9 ][0-9 ];1;;empty,validateas=1,invalid=Invalid date\\, for the input mask <br><b>'<%") + "mask%>'</b>!,warning=Invalid character!,select=4,leading= "); var_Items->set_CellValue(TVariant(h),TVariant(1),TVariant(var_Items->get_CellEditor(TVariant(h),TVariant(0))->Mask)); h = var_Items->AddItem(TVariant(TDateTime(2001,1,1).operator double())); var_Items->set_FormatCell(TVariant(h),TVariant(0),L"len(value) ? shortdateF(value) : ``"); Exgridlib_tlb::IEditorPtr var_Editor5 = var_Items->get_CellEditor(TVariant(h),TVariant(0)); var_Editor5->EditType = Exgridlib_tlb::EditTypeEnum::DateType; var_Editor5->Mask = TVariant(String("!99/99/9999;1;;empty,validateas=1,invalid=Invalid date\\, for the input mask <br><b>'<%mask%>'</b>!,warning=Invalid character!,") + "select=4,overtype,leading"); var_Items->set_CellValue(TVariant(h),TVariant(1),TVariant(var_Items->get_CellEditor(TVariant(h),TVariant(0))->Mask)); h = var_Items->AddItem(TVariant(TDateTime(2001,1,1).operator double())); var_Items->set_FormatCell(TVariant(h),TVariant(0),L"len(value) ? shortdateF(value) : ``"); Exgridlib_tlb::IEditorPtr var_Editor6 = var_Items->get_CellEditor(TVariant(h),TVariant(0)); var_Editor6->EditType = Exgridlib_tlb::EditTypeEnum::DateType; var_Editor6->Mask = TVariant(String("!00/00/0000;1;;empty,validateas=1,invalid=Invalid date\\, for the input mask <br><b>'<%mask%>'</b>!,warning=Invalid character!,") + "select=4,overtype,leading"); var_Items->set_CellValue(TVariant(h),TVariant(1),TVariant(var_Items->get_CellEditor(TVariant(h),TVariant(0))->Mask)); h = var_Items->AddItem(TVariant(TDateTime(2001,1,1).operator double())); var_Items->set_FormatCell(TVariant(h),TVariant(0),L"len(value) ? shortdateF(value) : ``"); Exgridlib_tlb::IEditorPtr var_Editor7 = var_Items->get_CellEditor(TVariant(h),TVariant(0)); var_Editor7->EditType = Exgridlib_tlb::EditTypeEnum::DateType; var_Editor7->Mask = TVariant(String("!00/00/0000;;0;empty,validateas=1,invalid=Invalid date\\, for the input mask <br><b>'<%mask%>'</b>!,warning=Invalid character!,") + "select=4,overtype"); var_Items->set_CellValue(TVariant(h),TVariant(1),TVariant(var_Items->get_CellEditor(TVariant(h),TVariant(0))->Mask)); h = var_Items->AddItem(TVariant(TDateTime(2001,1,1).operator double())); var_Items->set_FormatCell(TVariant(h),TVariant(0),L"len(value) ? shortdateF(value) : ``"); Exgridlib_tlb::IEditorPtr var_Editor8 = var_Items->get_CellEditor(TVariant(h),TVariant(0)); var_Editor8->EditType = Exgridlib_tlb::EditTypeEnum::DateType; var_Editor8->Mask = TVariant(String("!00/00/0000;;;empty,validateas=1,invalid=Invalid date\\, for the input mask <br><b>'<%mask%>'</b>!,warning=Invalid character!,s") + "elect=1,overtype"); var_Items->set_CellValue(TVariant(h),TVariant(1),TVariant(var_Items->get_CellEditor(TVariant(h),TVariant(0))->Mask)); Grid1->EndUpdate(); |
845 |
How can I display and edit an integer number to show grouping digits too ( no decimals)
Exgridlib_tlb::IColumnPtr var_Column = Grid1->Columns->Add(L"Float"); var_Column->FormatColumn = L"value format `0`"; Exgridlib_tlb::IEditorPtr var_Editor = var_Column->Editor; var_Editor->EditType = Exgridlib_tlb::EditTypeEnum::MaskType; var_Editor->Mask = L";;;float,digits=0"; Grid1->Items->AddItem(TVariant(192278)); |
844 |
How can I display and edit a float number to show grouping digits too
Exgridlib_tlb::IColumnPtr var_Column = Grid1->Columns->Add(L"Float"); var_Column->FormatColumn = L"value format ``"; Exgridlib_tlb::IEditorPtr var_Editor = var_Column->Editor; var_Editor->EditType = Exgridlib_tlb::EditTypeEnum::MaskType; var_Editor->Mask = L";;;float"; Grid1->Items->AddItem(TVariant(192278)); |
843 |
How can I mask a phone number
Grid1->CauseValidateValue = Exgridlib_tlb::ValidateValueType::exValidateCell; Grid1->DrawGridLines = Exgridlib_tlb::GridLinesEnum::exRowLines; Grid1->FullRowSelect = Exgridlib_tlb::CellSelectEnum::exColumnSel; Grid1->Columns->Add(L"Phone")->Editor->EditType = Exgridlib_tlb::EditTypeEnum::MaskType; Exgridlib_tlb::IItemsPtr var_Items = Grid1->Items; long h = var_Items->AddItem(TNoParam()); Exgridlib_tlb::IEditorPtr var_Editor = var_Items->get_CellEditor(TVariant(h),TVariant(0)); var_Editor->EditType = Exgridlib_tlb::EditTypeEnum::MaskType; var_Editor->Mask = TVariant(String("!(999) 000 0000;1;;select=1,empty,overtype,warning=invalid characer,invalid=The value you entered isn't appropriate for the inp") + "ut mask <b>'<%mask%>'</b> specified for this field."); h = var_Items->AddItem(TVariant("0123")); Exgridlib_tlb::IEditorPtr var_Editor1 = var_Items->get_CellEditor(TVariant(h),TVariant(0)); var_Editor1->EditType = Exgridlib_tlb::EditTypeEnum::MaskType; var_Editor1->Mask = L"!(999) 000 0000;2;;select=4"; h = var_Items->AddItem(TVariant("0123")); Exgridlib_tlb::IEditorPtr var_Editor2 = var_Items->get_CellEditor(TVariant(h),TVariant(0)); var_Editor2->EditType = Exgridlib_tlb::EditTypeEnum::MaskType; var_Editor2->Mask = L"`Phone: `!(999) 000-0000"; h = var_Items->AddItem(TVariant("(074) 876-1222")); Exgridlib_tlb::IEditorPtr var_Editor3 = var_Items->get_CellEditor(TVariant(h),TVariant(0)); var_Editor3->EditType = Exgridlib_tlb::EditTypeEnum::MaskType; var_Editor3->Mask = L"!(999) 000-0000;0"; |
842 |
Is it possible to display the ColorType fields using RGB format
Grid1->Columns->Add(L"Color")->Editor->EditType = Exgridlib_tlb::EditTypeEnum::ColorType; Exgridlib_tlb::IItemsPtr var_Items = Grid1->Items; var_Items->AddItem(TVariant(255)); long h = var_Items->AddItem(TVariant(255)); Exgridlib_tlb::IEditorPtr var_Editor = var_Items->get_CellEditor(TVariant(h),TVariant(0)); var_Editor->EditType = Exgridlib_tlb::EditTypeEnum::ColorType; var_Editor->Mask = L"`RGB(`{0,255}\\,{0,255}\\,{0,255}`)`;;0"; h = var_Items->AddItem(TVariant(255)); Exgridlib_tlb::IEditorPtr var_Editor1 = var_Items->get_CellEditor(TVariant(h),TVariant(0)); var_Editor1->EditType = Exgridlib_tlb::EditTypeEnum::ColorType; var_Editor1->Mask = L"`&H`XXXXXXXX`&`;;0;overtype,insertype,warning=Wrong!"; h = var_Items->AddItem(TVariant(255)); Exgridlib_tlb::IEditorPtr var_Editor2 = var_Items->get_CellEditor(TVariant(h),TVariant(0)); var_Editor2->EditType = Exgridlib_tlb::EditTypeEnum::ColorType; var_Editor2->Mask = L"`0x`XX `0x`XX `0x`XX;;0;overtype,insertype,warning=Wrong!"; h = var_Items->AddItem(TVariant(255)); Exgridlib_tlb::IEditorPtr var_Editor3 = var_Items->get_CellEditor(TVariant(h),TVariant(0)); var_Editor3->EditType = Exgridlib_tlb::EditTypeEnum::ColorType; var_Editor3->Mask = L"R{0,255} G{0,255} B{0,255};;0;overtype,insertype,warning=Wrong!"; h = var_Items->AddItem(TVariant(255)); Exgridlib_tlb::IEditorPtr var_Editor4 = var_Items->get_CellEditor(TVariant(h),TVariant(0)); var_Editor4->EditType = Exgridlib_tlb::EditTypeEnum::ColorType; var_Editor4->Mask = L"`(hexa) RGB 0x`XXXXXX;;0;overtype,insertype,warning=Wrong!"; h = var_Items->AddItem(TVariant(255)); Exgridlib_tlb::IEditorPtr var_Editor5 = var_Items->get_CellEditor(TVariant(h),TVariant(0)); var_Editor5->EditType = Exgridlib_tlb::EditTypeEnum::ColorType; var_Editor5->Mask = L"`(decimal) Red: `{0,255}` Green: `{0,255}` Blue: `{0,255};;0;overtype,insertype,warning=Wrong!"; h = var_Items->AddItem(TVariant(255)); Exgridlib_tlb::IEditorPtr var_Editor6 = var_Items->get_CellEditor(TVariant(h),TVariant(0)); var_Editor6->EditType = Exgridlib_tlb::EditTypeEnum::ColorType; var_Editor6->Mask = L"`(combine) Red: `{0,255}` Green: 0x`XX` Blue: `{0,255};;0;overtype,insertype,warning=Wrong!"; |
841 |
How can I add the ExComboBox as an user editor
// UserEditorClose event - Fired the user editor is about to be opened. void __fastcall TForm1::Grid1UserEditorClose(TObject *Sender,IDispatch *Object,Exgridlib_tlb::HITEM Item,long ColIndex) { // Items.CellValue(Item,ColIndex) = Object.Value } // UserEditorOleEvent event - Occurs when an user editor fires an event. void __fastcall TForm1::Grid1UserEditorOleEvent(TObject *Sender,IDispatch *Object,Exgridlib_tlb::IOleEvent *Ev,VARIANT_BOOL * CloseEditor,Exgridlib_tlb::HITEM Item,long ColIndex) { OutputDebugString( L"Ev" ); } // UserEditorOpen event - Occurs when an user editor is about to be opened. void __fastcall TForm1::Grid1UserEditorOpen(TObject *Sender,IDispatch *Object,Exgridlib_tlb::HITEM Item,long ColIndex) { // Object.Value = Me.Items.CellValue(Item,ColIndex) } Grid1->BeginUpdate(); Exgridlib_tlb::IEditorPtr var_Editor = Grid1->Columns->Add(L"Exontrol.ComboBox")->Editor; var_Editor->EditType = Exgridlib_tlb::EditTypeEnum::UserEditorType; var_Editor->UserEditor(L"Exontrol.ComboBox",L""); _tlb::ObjectPtr var_Object = var_Editor->UserEditorObject; Grid1->DrawGridLines = Exgridlib_tlb::GridLinesEnum::exRowLines; Grid1->DefaultItemHeight = 21; Exgridlib_tlb::IItemsPtr var_Items = Grid1->Items; var_Items->set_CellEditorVisible(TVariant(var_Items->AddItem(TVariant(10248))),TVariant(0),Exgridlib_tlb::EditorVisibleEnum::exEditorVisible); var_Items->set_CellEditorVisible(TVariant(var_Items->AddItem(TVariant(10249))),TVariant(0),Exgridlib_tlb::EditorVisibleEnum::exEditorVisible); var_Items->set_CellEditorVisible(TVariant(var_Items->AddItem(TVariant(10250))),TVariant(0),Exgridlib_tlb::EditorVisibleEnum::exEditorVisible); Grid1->EndUpdate(); |
840 |
How can I add a header row
Grid1->ShowLockedItems = true; Grid1->DrawGridLines = Exgridlib_tlb::GridLinesEnum::exVLines; Grid1->Columns->Add(L"C1"); Grid1->Columns->Add(L"C2"); Exgridlib_tlb::IItemsPtr var_Items = Grid1->Items; var_Items->set_LockedItemCount(Exgridlib_tlb::VAlignmentEnum::exTop,1); long h = var_Items->get_LockedItem(Exgridlib_tlb::VAlignmentEnum::exTop,0); var_Items->set_ItemBackColor(h,RGB(128,128,128)); var_Items->set_ItemForeColor(h,RGB(255,255,255)); var_Items->set_CellValue(TVariant(h),TVariant(0),TVariant("footer c1")); var_Items->set_CellValue(TVariant(h),TVariant(1),TVariant("footer c2")); var_Items->set_CellValue(TVariant(var_Items->AddItem(TVariant("cell"))),TVariant(1),TVariant("cell")); |
839 |
How can I add a footer row
Grid1->ShowLockedItems = true; Grid1->DrawGridLines = Exgridlib_tlb::GridLinesEnum::exVLines; Grid1->Columns->Add(L"C1"); Grid1->Columns->Add(L"C2"); Exgridlib_tlb::IItemsPtr var_Items = Grid1->Items; var_Items->set_LockedItemCount(Exgridlib_tlb::VAlignmentEnum::exBottom,1); long h = var_Items->get_LockedItem(Exgridlib_tlb::VAlignmentEnum::exBottom,0); var_Items->set_ItemBackColor(h,RGB(128,128,128)); var_Items->set_ItemForeColor(h,RGB(255,255,255)); var_Items->set_CellValue(TVariant(h),TVariant(0),TVariant("footer c1")); var_Items->set_CellValue(TVariant(h),TVariant(1),TVariant("footer c2")); var_Items->set_CellValue(TVariant(var_Items->AddItem(TVariant("cell"))),TVariant(1),TVariant("cell")); |
838 |
How can I programmatically add more columns to the sort bar and other to be sorted, but not included in the sort bar
Grid1->SortBarVisible = true; Exgridlib_tlb::IColumnsPtr var_Columns = Grid1->Columns; var_Columns->Add(L"0"); var_Columns->Add(L"1"); var_Columns->Add(L"2"); var_Columns->Add(L"3"); var_Columns->Add(L"4"); Grid1->Layout = L"multiplesort=\"C3:1 C4:2\";singlesort=\"C2:1\""; |
837 |
How can I fix a column, while other sizable and fill the control's client
Grid1->ColumnAutoResize = true; Grid1->Columns->Add(L"Sizable"); Exgridlib_tlb::IColumnPtr var_Column = Grid1->Columns->Add(L"F"); var_Column->AllowSizing = false; var_Column->Width = 16; |
836 |
Is it possible to use empty values on a PickEditType editor (method 2)
Exgridlib_tlb::IEditorPtr var_Editor = Grid1->Columns->Add(L"DropDown")->Editor; var_Editor->EditType = Exgridlib_tlb::EditTypeEnum::PickEditType; var_Editor->AddItem(0,L"",TNoParam()); var_Editor->AddItem(1,L"The first item",TNoParam()); var_Editor->AddItem(2,L"The second item",TNoParam()); var_Editor->AddItem(3,L"The third item",TNoParam()); Exgridlib_tlb::IItemsPtr var_Items = Grid1->Items; var_Items->AddItem(TVariant("The first item")); var_Items->AddItem(TVariant("")); var_Items->AddItem(TVariant("The third item")); |
835 |
Is it possible to use empty values on a PickEditType editor (method 1)
Exgridlib_tlb::IEditorPtr var_Editor = Grid1->Columns->Add(L"DropDown")->Editor; var_Editor->EditType = Exgridlib_tlb::EditTypeEnum::PickEditType; var_Editor->set_Option(Exgridlib_tlb::EditorOptionEnum::exPickAllowEmpty,TVariant(true)); var_Editor->AddItem(1,L"The first item",TNoParam()); var_Editor->AddItem(2,L"The second item",TNoParam()); var_Editor->AddItem(3,L"The third item",TNoParam()); Exgridlib_tlb::IItemsPtr var_Items = Grid1->Items; var_Items->AddItem(TVariant("The first item")); var_Items->AddItem(TVariant("")); var_Items->AddItem(TVariant("The third item")); |
834 |
How can I specify an unselectable cell
Grid1->BeginUpdate(); Exgridlib_tlb::IColumnsPtr var_Columns = Grid1->Columns; var_Columns->Add(L"C1"); var_Columns->Add(L"C2"); var_Columns->Add(L"C3"); Exgridlib_tlb::IItemsPtr var_Items = Grid1->Items; long h = var_Items->AddItem(TVariant("unselectable item")); var_Items->set_CellValue(TVariant(h),TVariant(1),TVariant("unselectable item")); var_Items->set_CellValue(TVariant(h),TVariant(2),TVariant("unselectable item")); var_Items->set_SelectableItem(h,false); h = var_Items->AddItem(TVariant("selectable cell")); var_Items->set_CellValue(TVariant(h),TVariant(1),TVariant("unselectable cell")); var_Items->set_CellEnabled(TVariant(h),TVariant(1),false); var_Items->set_CellForeColor(TVariant(h),TVariant(1),RGB(0,0,0)); var_Items->set_CellValue(TVariant(h),TVariant(2),TVariant("disabled cell")); var_Items->set_CellEnabled(TVariant(h),TVariant(2),false); h = var_Items->AddItem(TVariant("disabled item")); var_Items->set_CellValue(TVariant(h),TVariant(1),TVariant("disabled item")); var_Items->set_CellValue(TVariant(h),TVariant(2),TVariant("disabled item")); var_Items->set_EnableItem(h,false); var_Items->set_SelectableItem(h,false); Grid1->EndUpdate(); |
833 |
Is it possible to edit a float number without using of e/E/d/D (exponent) and +/- (signs) characters
Exgridlib_tlb::IEditorPtr var_Editor = Grid1->Columns->Add(L"Edit")->Editor; var_Editor->EditType = Exgridlib_tlb::EditTypeEnum::EditType; var_Editor->Numeric = Exgridlib_tlb::NumericEnum::exDisableSigns | Exgridlib_tlb::NumericEnum::exFloatInteger; Grid1->Items->AddItem(TVariant(1.22)); |
832 |
How can I edit a float number with no using of e/E/d/D and + character
Exgridlib_tlb::IEditorPtr var_Editor = Grid1->Columns->Add(L"Edit")->Editor; var_Editor->EditType = Exgridlib_tlb::EditTypeEnum::EditType; var_Editor->Numeric = Exgridlib_tlb::NumericEnum::exDisablePlus | Exgridlib_tlb::NumericEnum::exFloatInteger; Grid1->Items->AddItem(TVariant(1.22)); |
831 |
Is it possible to edit a float number with no using of e/E/d/D (exponent) characters
Exgridlib_tlb::IEditorPtr var_Editor = Grid1->Columns->Add(L"Edit")->Editor; var_Editor->EditType = Exgridlib_tlb::EditTypeEnum::EditType; var_Editor->Numeric = Exgridlib_tlb::NumericEnum::exFloatInteger; Grid1->Items->AddItem(TVariant(1.22)); |
830 |
How can I edit an integer with no using of +/- signs
Exgridlib_tlb::IEditorPtr var_Editor = Grid1->Columns->Add(L"Edit")->Editor; var_Editor->EditType = Exgridlib_tlb::EditTypeEnum::EditType; var_Editor->Numeric = Exgridlib_tlb::NumericEnum(0xfc | Exgridlib_tlb::NumericEnum::exDisableSigns | Exgridlib_tlb::NumericEnum::exFloatInteger | Exgridlib_tlb::NumericEnum::exFloat); Grid1->Items->AddItem(TVariant(1)); |
829 |
When I'm trying to show string with "line break" character (vbCrLF) in a textbox, it shows 2 squares. Is there any way to hide these squares
Exgridlib_tlb::IColumnsPtr var_Columns = Grid1->Columns; var_Columns->Add(L"Value"); Exgridlib_tlb::IColumnPtr var_Column = var_Columns->Add(L"CellSingleLine = False"); var_Column->ComputedField = L"%0"; var_Column->set_Def(Exgridlib_tlb::DefColumnEnum::exCellSingleLine,TVariant(false)); Exgridlib_tlb::IColumnPtr var_Column1 = var_Columns->Add(L"FormatColumn/replace CRLF"); var_Column1->ComputedField = L"%0"; var_Column1->FormatColumn = L"value replace `\\r\\n` with ``"; Exgridlib_tlb::IColumnPtr var_Column2 = var_Columns->Add(L"FormatColumn/replace TAB,CRLF"); var_Column2->ComputedField = L"%0"; var_Column2->FormatColumn = L"(value replace `\\t` with ``) replace `\\r\\n` with ``"; Exgridlib_tlb::IItemsPtr var_Items = Grid1->Items; var_Items->AddItem(TVariant("a\\ta\\r\\nb\\tb")); |
828 |
Is there any way to "unselect" radio group
// DblClick event - Occurs when the user dblclk the left mouse button over an object. void __fastcall TForm1::Grid1DblClick(TObject *Sender,short Shift,int X,int Y) { Exgridlib_tlb::IItemsPtr var_Items = Grid1->Items; long h = var_Items->get_CellChecked(1234); var_Items->set_CellHasCheckBox(TVariant(0),TVariant(h),true); var_Items->set_CellState(TVariant(0),TVariant(h),0); var_Items->set_CellHasCheckBox(TVariant(0),TVariant(h),false); } // SelectionChanged event - Fired after a new item has been selected. void __fastcall TForm1::Grid1SelectionChanged(TObject *Sender) { Exgridlib_tlb::IItemsPtr var_Items = Grid1->Items; var_Items->set_CellState(TVariant(var_Items->FocusItem),TVariant(0),1); } Grid1->MarkSearchColumn = false; Grid1->SelBackColor = RGB(255,255,128); Grid1->SelForeColor = RGB(0,0,0); Grid1->Columns->Add(L"Default"); Exgridlib_tlb::IItemsPtr var_Items = Grid1->Items; long h = var_Items->AddItem(TVariant("Radio 1")); var_Items->set_CellHasRadioButton(TVariant(h),TVariant(0),true); var_Items->set_CellRadioGroup(TVariant(h),TVariant(0),1234); h = var_Items->AddItem(TVariant("Radio 2")); var_Items->set_CellHasRadioButton(TVariant(h),TVariant(0),true); var_Items->set_CellRadioGroup(TVariant(h),TVariant(0),1234); var_Items->set_CellState(TVariant(h),TVariant(0),1); h = var_Items->AddItem(TVariant("Radio 3")); var_Items->set_CellHasRadioButton(TVariant(h),TVariant(0),true); var_Items->set_CellRadioGroup(TVariant(h),TVariant(0),1234); |
827 |
The Column.Alignment property does not seem to work for cells with images in them. What can be done
Grid1->BeginUpdate(); Grid1->Images(TVariant(String("gBJJgBAIDAAGAAEAAQhYAf8Pf4hh0QihCJo2AEZjQAjEZFEaIEaEEaAIAkcbk0olUrlktl0vmExmUzmk1m03nE5nU7nk9n0/oFBoVDolFo1HpFJpVLplNp1PqFRqVTq") + "lVq1XrFZrVbrldr1fsFhsVjslls1ntFptVrtltt1vuFxuVzul1u13vF5vV7vl9v1/wGBwWDwmFw2HxGJxWLxmNx0xiFdyOTh8Tf9ZymXx+QytcyNgz8r0OblWjyWds+m" + "0ka1Vf1ta1+r1mos2xrG2xeZ0+a0W0qOx3GO4NV3WeyvD2XJ5XL5nN51aiw+lfSj0gkUkAEllHanHI5j/cHg8EZf7w8vl8j4f/qfEZeB09/vjLAB30+kZQAP/P5/H6/y" + "NAOAEAwCjMBwFAEDwJBMDwLBYAP2/8Hv8/gAGAD8LQs9w/nhDY/oygIA=")); Grid1->TreeColumnIndex = -1; Grid1->DrawGridLines = Exgridlib_tlb::GridLinesEnum::exAllLines; Grid1->HeaderHeight = 24; Grid1->DefaultItemHeight = 24; Exgridlib_tlb::IColumnPtr var_Column = Grid1->Columns->Add(L"Image"); var_Column->AllowSizing = false; var_Column->Width = 32; var_Column->HTMLCaption = L"<img>1</img>"; var_Column->HeaderAlignment = Exgridlib_tlb::AlignmentEnum::CenterAlignment; var_Column->Alignment = Exgridlib_tlb::AlignmentEnum::CenterAlignment; var_Column->set_Def(Exgridlib_tlb::DefColumnEnum::exCellValueFormat,TVariant(1)); Grid1->Columns->Add(L"Rest"); Exgridlib_tlb::IItemsPtr var_Items = Grid1->Items; var_Items->AddItem(TVariant("<img>1</img>")); var_Items->AddItem(TVariant("<img>2</img>")); var_Items->AddItem(TVariant("<img>3</img>")); Grid1->EndUpdate(); |
826 |
Can I change the format of date to be shown in the control
Exgridlib_tlb::IColumnsPtr var_Columns = Grid1->Columns; var_Columns->Add(L"Default"); Exgridlib_tlb::IColumnPtr var_Column = var_Columns->Add(L"Format.1"); var_Column->ComputedField = L"%0"; var_Column->FormatColumn = L"dateF(value) replace `/` with `-`"; Exgridlib_tlb::IColumnPtr var_Column1 = var_Columns->Add(L"Format.2"); var_Column1->ComputedField = L"%0"; var_Column1->set_Def(Exgridlib_tlb::DefColumnEnum::exCellValueFormat,TVariant(1)); var_Column1->FormatColumn = L"`<b>`+ shortdate(value) + `</b> ` + timeF(value)"; Exgridlib_tlb::IColumnPtr var_Column2 = var_Columns->Add(L"Format.3"); var_Column2->ComputedField = L"%0"; var_Column2->set_Def(Exgridlib_tlb::DefColumnEnum::exCellValueFormat,TVariant(1)); var_Column2->FormatColumn = TVariant(String("( dateF(value) replace `/` with `-` ) + ` <b>`+ ( weekday(value) case ( 0 : `Su`; 1 : `Mo`; 2 : `Tu`; 3 : `We`; 4 : `Th`; 5 : `") + "Fr`; 6 : `Sa`) )"); Exgridlib_tlb::IItemsPtr var_Items = Grid1->Items; var_Items->AddItem(TVariant(TDateTime(2001,1,1,10,00,00,0).operator double())); var_Items->AddItem(TVariant(TDateTime(2001,1,2,10,00,00,0).operator double())); |
825 |
How do I arrange my columns on multiple levels
Grid1->BeginUpdate(); Grid1->ColumnAutoResize = false; Grid1->DrawGridLines = Exgridlib_tlb::GridLinesEnum::exAllLines; Exgridlib_tlb::IColumnsPtr var_Columns = Grid1->Columns; Exgridlib_tlb::IColumnPtr var_Column = var_Columns->Add(L"C0"); var_Column->ExpandColumns = L"1,2"; var_Column->DisplayExpandButton = false; var_Columns->Add(L"C1"); var_Columns->Add(L"C2"); var_Columns->Add(L"C3"); Exgridlib_tlb::IColumnPtr var_Column1 = var_Columns->Add(L"C4"); var_Column1->ExpandColumns = L"5,6"; var_Column1->DisplayExpandButton = false; var_Columns->Add(L"C5"); Exgridlib_tlb::IColumnPtr var_Column2 = var_Columns->Add(L"C6"); var_Column2->ExpandColumns = L"6,7"; var_Column2->DisplayExpandButton = false; var_Columns->Add(L"C7"); Grid1->EndUpdate(); |
824 |
Does your control support expandable header or columns, so I can arrange it on multiple levels
Grid1->BeginUpdate(); Grid1->DrawGridLines = Exgridlib_tlb::GridLinesEnum::exAllLines; Grid1->BackColorLevelHeader = RGB(240,240,240); Exgridlib_tlb::IColumnsPtr var_Columns = Grid1->Columns; Exgridlib_tlb::IColumnPtr var_Column = var_Columns->Add(L"Photo"); var_Column->AllowSizing = false; var_Column->Width = 32; var_Columns->Add(L"Personal Info"); var_Columns->Add(L"Title"); var_Columns->Add(L"Name"); var_Columns->Add(L"First"); var_Columns->Add(L"Last"); var_Columns->Add(L"Address"); var_Columns->get_Item(TVariant("Personal Info"))->ExpandColumns = L"2,3"; Exgridlib_tlb::IColumnPtr var_Column1 = var_Columns->get_Item(TVariant("Name")); var_Column1->ExpandColumns = L"4,5"; var_Column1->Expanded = false; Grid1->EndUpdate(); |
823 |
How can I use the MinWidthAutoResize/MaxWidthAutoResize
Grid1->BeginUpdate(); Grid1->ColumnAutoResize = false; /* Select the Component\Import Component...\Import a Type Library, to import the following Type Library: Microsoft ActiveX Data Objects 6.1 Library TypeLib: msado15.dll to define the namespace: Adodb_tlb */ //#include "ADODB_TLB.h" Adodb_tlb::_RecordsetPtr rs = Variant::CreateObject(L"ADOR.Recordset"); rs->Open(TVariant("Orders"),TVariant("Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\\Program Files\\Exontrol\\ExGrid\\Sample\\Access\\misc.accdb"),Adodb_tlb::CursorTypeEnum::adOpenStatic,Adodb_tlb::LockTypeEnum::adLockOptimistic,0); Grid1->DataSource = (IDispatch*)rs; Exgridlib_tlb::IColumnPtr var_Column = Grid1->Columns->get_Item(TVariant(0)); var_Column->MaxWidthAutoResize = 32; var_Column->WidthAutoResize = true; Grid1->EndUpdate(); |
822 |
Does your control support subscript or superscript, in HTML captions
Grid1->ColumnAutoResize = false; Grid1->HeaderHeight = 28; Grid1->DefaultItemHeight = 24; Exgridlib_tlb::IColumnsPtr var_Columns = Grid1->Columns; Exgridlib_tlb::IColumnPtr var_Column = var_Columns->Add(L"Column 1"); var_Column->HTMLCaption = L"Column <b><off 2><font ;6>1"; var_Column->set_Def(Exgridlib_tlb::DefColumnEnum::exCellValueFormat,TVariant(1)); Exgridlib_tlb::IColumnPtr var_Column1 = var_Columns->Add(L"Column 2"); var_Column1->HTMLCaption = L"Column <b><off 2><font ;6>2"; var_Column1->set_Def(Exgridlib_tlb::DefColumnEnum::exCellValueFormat,TVariant(1)); Exgridlib_tlb::IColumnPtr var_Column2 = var_Columns->Add(L"Column 3"); var_Column2->HTMLCaption = L"Column <b><off 2><font ;6>3"; var_Column2->set_Def(Exgridlib_tlb::DefColumnEnum::exCellValueFormat,TVariant(1)); Exgridlib_tlb::IItemsPtr var_Items = Grid1->Items; long h = var_Items->AddItem(TVariant("Item <font ;6><off 4>1")); var_Items->set_CellValue(TVariant(h),TVariant(1),TVariant("Item <font ;6><off -6>2")); var_Items->set_CellValue(TVariant(h),TVariant(2),TVariant("Item <b><font ;6><off -6>2<off 4>3<off 4>1")); |
821 |
How can I specify the splited cell's background color
Grid1->MarkSearchColumn = false; Grid1->TreeColumnIndex = -1; Grid1->Columns->Add(L"1")->set_Def(Exgridlib_tlb::DefColumnEnum::exCellBackColor,TVariant(255)); Exgridlib_tlb::IColumnPtr var_Column = Grid1->Columns->Add(L"2"); var_Column->Width = 32; var_Column->AllowSizing = false; Exgridlib_tlb::IItemsPtr var_Items = Grid1->Items; long h = var_Items->AddItem(TVariant("The Item's background color inherits the Column.Def(exCellBackColor)")); var_Items->set_ItemDivider(h,0); h = var_Items->AddItem(TVariant("The Item's background color inherits the CellBackColor()")); var_Items->set_ItemDivider(h,0); var_Items->set_CellBackColor(TVariant(h),TNoParam(),RGB(0,255,0)); h = var_Items->AddItem(TVariant("The Item's background color inherits the CellBackColor(), while the split inherits from the Column.Def(exCellBackColor) ")); var_Items->set_ItemDivider(h,0); var_Items->set_CellBackColor(TVariant(h),TNoParam(),RGB(0,255,0)); TVariant var_SplitCell = TVariant(var_Items->get_SplitCell(TVariant(h),TVariant(0))); h = var_Items->AddItem(TVariant("The Item's background color inherits the CellBackColor()")); var_Items->set_ItemDivider(h,0); var_Items->set_CellBackColor(TVariant(h),TNoParam(),RGB(0,255,0)); var_Items->set_CellBackColor(TVariant(0),TVariant(var_Items->get_SplitCell(TVariant(h),TVariant(0))),RGB(0,0,255)); |
820 |
How can I specify a fixed width for a column
Grid1->MarkSearchColumn = false; Grid1->TreeColumnIndex = -1; Grid1->ColumnAutoResize = false; Exgridlib_tlb::IColumnPtr var_Column = Grid1->Columns->Add(L"C1"); var_Column->Width = 17; var_Column->AllowSizing = false; Exgridlib_tlb::IColumnPtr var_Column1 = Grid1->Columns->Add(L"C2"); var_Column1->Width = 17; var_Column1->AllowSizing = false; Grid1->Columns->Add(L"Other"); Grid1->ColumnAutoResize = true; |
819 |
How can I split a cell in three parts
Grid1->BeginUpdate(); Grid1->DrawGridLines = Exgridlib_tlb::GridLinesEnum::exAllLines; Grid1->Columns->Add(L"Default"); Exgridlib_tlb::IItemsPtr var_Items = Grid1->Items; long h = var_Items->AddItem(TVariant("entire")); h = var_Items->AddItem(TVariant("split 1")); h = TVariant(var_Items->get_SplitCell(TVariant(h),TVariant(0))); var_Items->set_CellValue(TVariant(0),TVariant(h),TVariant("split 2")); h = TVariant(var_Items->get_SplitCell(TVariant(0),TVariant(h))); var_Items->set_CellValue(TVariant(0),TVariant(h),TVariant("split 3")); h = var_Items->AddItem(TVariant("entire")); Grid1->EndUpdate(); |
818 |
How can I find if there is any filter applied to the control
// FilterChange event - Occurs when filter was changed. void __fastcall TForm1::Grid1FilterChange(TObject *Sender) { OutputDebugString( L"If negative, the filter is present, else not" ); OutputDebugString( PChar(Grid1->Items->VisibleItemCount) ); } Grid1->BeginUpdate(); Grid1->LinesAtRoot = Exgridlib_tlb::LinesAtRootEnum::exLinesAtRoot; Grid1->TreeColumnIndex = -1; Grid1->FilterInclude = Exgridlib_tlb::FilterIncludeEnum::exMatchingItemsOnly; Exgridlib_tlb::IColumnPtr var_Column = Grid1->Columns->Add(L"Column"); var_Column->DisplayFilterButton = true; var_Column->FilterType = Exgridlib_tlb::FilterTypeEnum::exFilter; var_Column->Filter = L"C1"; Exgridlib_tlb::IItemsPtr var_Items = Grid1->Items; long h = var_Items->AddItem(TVariant("R1")); var_Items->InsertItem(h,TNoParam(),TVariant("C1")); var_Items->InsertItem(h,TNoParam(),TVariant("C2")); var_Items->set_ExpandItem(h,true); h = var_Items->AddItem(TVariant("R2")); var_Items->InsertItem(h,TNoParam(),TVariant("C1")); var_Items->InsertItem(h,TNoParam(),TVariant("C2")); Grid1->ApplyFilter(); Grid1->EndUpdate(); |
817 |
How can I prevent showing the lines for the hierarchy while using the exMatchingItemsOnly option
Grid1->BeginUpdate(); Grid1->LinesAtRoot = Exgridlib_tlb::LinesAtRootEnum::exLinesAtRoot; Grid1->TreeColumnIndex = -1; Grid1->FilterInclude = Exgridlib_tlb::FilterIncludeEnum::exMatchingItemsOnly; Exgridlib_tlb::IColumnPtr var_Column = Grid1->Columns->Add(L"Column"); var_Column->DisplayFilterButton = true; var_Column->FilterType = Exgridlib_tlb::FilterTypeEnum::exFilter; var_Column->Filter = L"C1|C2"; Exgridlib_tlb::IItemsPtr var_Items = Grid1->Items; long h = var_Items->AddItem(TVariant("R1")); var_Items->InsertItem(h,TNoParam(),TVariant("C1")); var_Items->InsertItem(h,TNoParam(),TVariant("C2")); var_Items->set_ExpandItem(h,true); h = var_Items->AddItem(TVariant("R2")); var_Items->InsertItem(h,TNoParam(),TVariant("C1")); var_Items->InsertItem(h,TNoParam(),TVariant("C2")); Grid1->ApplyFilter(); Grid1->EndUpdate(); |
816 |
Is there any method to get only the matched items and not the items with his parent
Grid1->BeginUpdate(); Grid1->LinesAtRoot = Exgridlib_tlb::LinesAtRootEnum::exLinesAtRoot; Grid1->FilterInclude = Exgridlib_tlb::FilterIncludeEnum::exMatchingItemsOnly; Exgridlib_tlb::IColumnPtr var_Column = Grid1->Columns->Add(L"Column"); var_Column->DisplayFilterButton = true; var_Column->FilterType = Exgridlib_tlb::FilterTypeEnum::exFilter; var_Column->Filter = L"C1|C2"; Exgridlib_tlb::IItemsPtr var_Items = Grid1->Items; long h = var_Items->AddItem(TVariant("R1")); var_Items->InsertItem(h,TNoParam(),TVariant("C1")); var_Items->InsertItem(h,TNoParam(),TVariant("C2")); var_Items->set_ExpandItem(h,true); h = var_Items->AddItem(TVariant("R2")); var_Items->InsertItem(h,TNoParam(),TVariant("C1")); var_Items->InsertItem(h,TNoParam(),TVariant("C2")); Grid1->ApplyFilter(); Grid1->EndUpdate(); |
815 |
Is there any property I can save and restore automatically the current setting, column position, size, and so on (2)
Grid1->BeginUpdate(); Grid1->Columns->Add(L"Column"); Exgridlib_tlb::IItemsPtr var_Items = Grid1->Items; var_Items->AddItem(TVariant("Item 1")); var_Items->AddItem(TVariant("Item 2")); var_Items->AddItem(TVariant("Item 3")); Grid1->Layout = L"Select=\"0\";SingleSort=\"C0:2\";Columns=1"; Grid1->EndUpdate(); |
814 |
Is there any property I can save and restore automatically the current setting, column position, size, and so on (1)
Grid1->BeginUpdate(); Grid1->Columns->Add(L"Column"); Exgridlib_tlb::IItemsPtr var_Items = Grid1->Items; var_Items->AddItem(TVariant("Item 1")); var_Items->AddItem(TVariant("Item 2")); var_Items->AddItem(TVariant("Item 3")); Grid1->Layout = TVariant(String("gBjAAwAAuABmABpABsAB0ABlAByhoAPIAOEPAA9gYABoABQAgUEg0XN4AOcJicKkpujMbjsfkMFk0YhkQgUOjUEl8gjcGO0ok8KMULjEaGMcj08kQAO8oMkTNEtGwAG") + "QAqc7gUlhh1ABtAEsk9GpEfhElgVcsMupNlnlonlaAFcr0shUsp8QPEtnVJqJhmcIhUMh0QiU5sYAqMngUSuEMw07k8Qv0SgVRrNEuVflF2jF5x9JyNEm0TjQijemyE0" + "jE3t+YruauoAu4Az1qj9BzRn0UzksSnAA0xDjY6qnAw8OiUQ0dwzN0zWz2t7j8/xURAGNvWH6k8xlEhklhEI0O/6QAgI="); Grid1->EndUpdate(); |
813 |
I have noticed that the column's header is changed once the cursor hovers it. Is it possible to change that visual appearance
|
812 |
Is it possible to change the visual appearance of the columns selector/floating bar(3)
Grid1->ColumnAutoResize = false; Exgridlib_tlb::IColumnsPtr var_Columns = Grid1->Columns; var_Columns->Add(L"Column 1"); var_Columns->Add(L"Column 2")->Visible = false; Grid1->VisualAppearance->Add(2,TVariant("c:\\exontrol\\images\\normal.ebn")); Grid1->VisualAppearance->Add(3,TVariant("c:\\exontrol\\images\\pushed.ebn")); Grid1->Background[Exgridlib_tlb::BackgroundPartEnum::exColumnsFloatAppearance] = 0x2000000; Grid1->Background[Exgridlib_tlb::BackgroundPartEnum::exColumnsFloatBackColor] = 0x3000000; Grid1->Background[Exgridlib_tlb::BackgroundPartEnum::exColumnsFloatCaptionBackColor] = RGB(246,245,240); Grid1->ColumnsFloatBarVisible = Exgridlib_tlb::ColumnsFloatBarVisibleEnum::exColumnsFloatBarVisibleIncludeHiddenColumns; |
811 |
Is it possible to change the visual appearance of the columns selector/floating bar(2)
Grid1->ColumnAutoResize = false; Exgridlib_tlb::IColumnsPtr var_Columns = Grid1->Columns; var_Columns->Add(L"Column 1"); var_Columns->Add(L"Column 2")->Visible = false; Grid1->VisualAppearance->Add(3,TVariant("c:\\exontrol\\images\\pushed.ebn")); Grid1->Background[Exgridlib_tlb::BackgroundPartEnum::exColumnsFloatBackColor] = 0x3000000; Grid1->ColumnsFloatBarVisible = Exgridlib_tlb::ColumnsFloatBarVisibleEnum::exColumnsFloatBarVisibleIncludeHiddenColumns; |
810 |
Is it possible to change the visual appearance of the columns selector/floating bar(1)
Grid1->VisualAppearance->Add(2,TVariant("c:\\exontrol\\images\\normal.ebn")); Grid1->Background[Exgridlib_tlb::BackgroundPartEnum::exColumnsFloatAppearance] = 0x2000000; Grid1->Background[Exgridlib_tlb::BackgroundPartEnum::exColumnsFloatBackColor] = RGB(246,245,240); Grid1->Background[Exgridlib_tlb::BackgroundPartEnum::exColumnsFloatCaptionBackColor] = RGB(246,245,240); Grid1->ColumnsFloatBarVisible = Exgridlib_tlb::ColumnsFloatBarVisibleEnum::exColumnsFloatBarVisibleIncludeHiddenColumns; |
809 |
I am using the ColumnsFloatBarVisible property on True, but still not able to add any column on that list
|
808 |
Is it possible to list a column to columns selector/floating bar, but still user can use it
Grid1->ColumnAutoResize = false; Exgridlib_tlb::IColumnsPtr var_Columns = Grid1->Columns; var_Columns->Add(L"Column 1"); var_Columns->Add(L"Column 2")->Visible = false; Exgridlib_tlb::IColumnPtr var_Column = var_Columns->Add(L"Column 3"); var_Column->Visible = false; var_Column->Enabled = false; Grid1->ColumnsFloatBarVisible = Exgridlib_tlb::ColumnsFloatBarVisibleEnum::exColumnsFloatBarVisibleIncludeHiddenColumns; |
807 |
How can I prevent a specific column not to be listed in the columns selector/floating bar
|
806 |
Is it possible to change the "Columns" caption being shown in the columns selector/floating bar
|
805 |
How can I show the columns selector, so the user can drag and drop columns to the view
|
804 |
The column's header is changed while the cursor hovers it. Is it possible to prevent that
|
803 |
I noticed that when grouping on a field, its details are always expanded. Is it possible to show collapsed by default (method 2)
Grid1->BeginUpdate(); Grid1->ColumnAutoResize = false; /* Select the Component\Import Component...\Import a Type Library, to import the following Type Library: Microsoft ActiveX Data Objects 6.1 Library TypeLib: msado15.dll to define the namespace: Adodb_tlb */ //#include "ADODB_TLB.h" Adodb_tlb::_RecordsetPtr rs = Variant::CreateObject(L"ADOR.Recordset"); rs->Open(TVariant("Orders"),TVariant("Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\\Program Files\\Exontrol\\ExGrid\\Sample\\Access\\misc.accdb"),Adodb_tlb::CursorTypeEnum::adOpenStatic,Adodb_tlb::LockTypeEnum::adLockOptimistic,0); Grid1->DataSource = (IDispatch*)rs; Grid1->SortBarVisible = true; Grid1->SortBarCaption = L"Drag a <b>column</b> header here to group by that column."; Grid1->AllowGroupBy = true; Grid1->Columns->get_Item(TVariant(1))->SortOrder = Exgridlib_tlb::SortOrderEnum::SortAscending; Grid1->EndUpdate(); Grid1->BeginUpdate(); Grid1->EnsureVisibleColumn(TVariant(0)); Grid1->Items->set_ExpandItem(0,false); Grid1->EndUpdate(); |
802 |
I noticed that when grouping on a field, its details are always expanded. Is it possible to show collapsed by default (method 1)
// AddGroupItem event - Occurs after a new Group Item has been inserted to Items collection. void __fastcall TForm1::Grid1AddGroupItem(TObject *Sender,Exgridlib_tlb::HITEM Item) { Grid1->Items->set_ExpandItem(Item,false); } Grid1->BeginUpdate(); Grid1->ColumnAutoResize = false; /* Select the Component\Import Component...\Import a Type Library, to import the following Type Library: Microsoft ActiveX Data Objects 6.1 Library TypeLib: msado15.dll to define the namespace: Adodb_tlb */ //#include "ADODB_TLB.h" Adodb_tlb::_RecordsetPtr rs = Variant::CreateObject(L"ADOR.Recordset"); rs->Open(TVariant("Orders"),TVariant("Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\\Program Files\\Exontrol\\ExGrid\\Sample\\Access\\misc.accdb"),Adodb_tlb::CursorTypeEnum::adOpenStatic,Adodb_tlb::LockTypeEnum::adLockOptimistic,0); Grid1->DataSource = (IDispatch*)rs; Grid1->SortBarVisible = true; Grid1->SortBarCaption = L"Drag a <b>column</b> header here to group by that column."; Grid1->AllowGroupBy = true; Grid1->Columns->get_Item(TVariant(1))->SortOrder = Exgridlib_tlb::SortOrderEnum::SortAscending; Grid1->EndUpdate(); |
801 |
Is there a possibility to expand / collapse all groups (or group by group) at runtime with a method (equivalent to pressing the + or - button in the group header)
Grid1->BeginUpdate(); Grid1->ColumnAutoResize = false; /* Select the Component\Import Component...\Import a Type Library, to import the following Type Library: Microsoft ActiveX Data Objects 6.1 Library TypeLib: msado15.dll to define the namespace: Adodb_tlb */ //#include "ADODB_TLB.h" Adodb_tlb::_RecordsetPtr rs = Variant::CreateObject(L"ADOR.Recordset"); rs->Open(TVariant("Orders"),TVariant("Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\\Program Files\\Exontrol\\ExGrid\\Sample\\Access\\misc.accdb"),Adodb_tlb::CursorTypeEnum::adOpenStatic,Adodb_tlb::LockTypeEnum::adLockOptimistic,0); Grid1->DataSource = (IDispatch*)rs; Grid1->SortBarVisible = true; Grid1->SortBarCaption = L"Drag a <b>column</b> header here to group by that column."; Grid1->AllowGroupBy = true; Grid1->Columns->get_Item(TVariant(1))->SortOrder = Exgridlib_tlb::SortOrderEnum::SortAscending; Grid1->EndUpdate(); Grid1->EnsureVisibleColumn(TVariant(0)); Grid1->BeginUpdate(); Exgridlib_tlb::IItemsPtr var_Items = Grid1->Items; var_Items->set_ExpandItem(var_Items->get_RootItem(0),false); var_Items->set_ExpandItem(var_Items->get_RootItem(1),false); var_Items->set_ExpandItem(var_Items->get_RootItem(2),false); Grid1->EndUpdate(); |